nginx里有https的网站也有http的网站,http的站如果加https总是跳到其他站的解决方法,如:
我现在有2个站点,https://www.a.com和http://www.b.com,
当我把不是https的站也用https请求的时候,就会跳转到https的那个源码。
比如我打开https://www.b.com(用https的方式请求http的网站)就会显示https://www.a.com的源码
(同一台服务器里同时有http和https站点,给http站点加上https来访问就会跳转到默认的第一个https站点)
解决方法:修改宝塔里所有https站点的nginx的配置即可,代码如下:
server { listen 80; #listen 443 ssl http2; listen 111.111.11.11:443 ssl; server_name a.com www.a.com 111.111.11.11; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/a.com; #下面是其他配置,省略。。。。
上一篇: 《建站管家》二次开发文档
下一篇: Argument 1 passed to think\db\Query::getFieldType() must be of the type string, int given的解决方法