宝塔配置完SSL之后访问显示403 forbidden问题解决

1. 宝塔配置好SSL

背景

  • 域名购买于腾讯云
  • SSL是申请的免费证书
  • 服务器购买于腾讯云但不在我名下

配置SSL证书

保姆级配置过程见腾讯云宝塔轻量服务器Linux如何开启SSL证书


2. 访问显示403

假设我的域名是hot.aisa,配置完我在浏览器输入https://www.hot.asia,结果返回了大大的
403 Forbidden

3. 解决问题

经查, 原来是配置文件夹下没有对应的目录文件

  • 在宝塔配置中可以看到是需要有默认的目录文件的
    在这里插入图片描述
  • 访问实际文件夹,发现没有这些文件
    在这里插入图片描述
  • 那就创建一个
    vim index.html
    
    直接导入Python之禅
    The Zen of Python, by Tim Peters<br>
    <br>
    Beautiful is better than ugly.<br>
    Explicit is better than implicit.<br>
    Simple is better than complex.<br>
    Complex is better than complicated.<br>
    Flat is better than nested.<br>
    Sparse is better than dense.<br>
    Readability counts.<br>
    Special cases aren't special enough to break the rules.<br>
    Although practicality beats purity.<br>
    Errors should never pass silently.<br>
    Unless explicitly silenced.<br>
    In the face of ambiguity, refuse the temptation to guess.<br>
    There should be one-- and preferably only one --obvious way to do it.<br>
    Although that way may not be obvious at first unless you're Dutch.<br>
    Now is better than never.<br>
    Although never is often better than *right* now.<br>
    If the implementation is hard to explain, it's a bad idea.<br>
    If the implementation is easy to explain, it may be a good idea.<br>
    Namespaces are one honking great idea -- let's do more of those!
    
    保存退出

4. 访问成功!

再次在浏览器输入https://www.hot.asia,显示Python之禅!
在这里插入图片描述

结论

原来是nginx没有找到对应的目录文件,随便创建一个放进去就好了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

但老师

要是看起来爽 求打赏一耳光

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值