首页 > 编程知识 正文

虚拟主机http跳转到https,https嵌入http网页

时间:2023-05-05 09:22:33 阅读:140822 作者:22

某网站刚刚成功安装了let’s encrypt的免费证书,nginx已经配置了对https的访问。

现在可以同时通过https和http进行访问。 有些页面可以同时访问,但有些页面从https访问时,竟然会有301跳转到http页面地址。 示例:

为什么会这样呢? 感谢您的聆听。

nginx的结构如下。

服务器{

listen 80

server_name www.phpernote.com;

root /home/xxx/xxx;

位置/{

index index.php index.html;

}

include /home/xxx/xxx/.htaccess;

location ~ ^? (?

fastcgi _ pass UNIX :/tmp/PHP-CGI.sock;

fastcgi_index index.php;

fastcgi _ split _ path _ info ^ (.(.PHP )/. ) $;

fastcgi _ param script _ filename $ document _ root $ fastcgi _ script _ name;

fastcgi _ param path _ info $ fastcgi _ path _ info;

fastcgi _ param path _ translated $ document _ root $ fastcgi _ path _ info;

include fastcgi_params;

}

}

服务器{

listen 80

server_name phpernote.com;

root /home/xxx/xxx;

位置/{

index index.php index.html;

}

include /home/xxx/xxx/.htaccess;

location ~ ^? (?

fastcgi _ pass UNIX :/tmp/PHP-CGI.sock;

fastcgi_index index.php;

fastcgi _ split _ path _ info ^ (.(.PHP )/. ) $;

fastcgi _ param script _ filename $ document _ root $ fastcgi _ script _ name;

fastcgi _ param path _ info $ fastcgi _ path _ info;

fastcgi _ param path _ translated $ document _ root $ fastcgi _ path _ info;

include fastcgi_params;

}

}

服务器{

listen 443 ssl;

ssl on;

SSL _ certificate/etc/lets encrypt/live/www.phper note.com/full chain.PEM;

SSL _ certificate _ key/etc/lets encrypt/live/www.phper note.com/privkey.PEM;

server_name www.phpernote.com;

root /home/xxx/xxx;

位置/{

index index.php index.html;

}

include /home/xxx/xxx/.htaccess;

location ~ ^? (?

fastcgi _ pass UNIX :/tmp/PHP-CGI.sock;

fastcgi_index index.php;

fastcgi _ split _ path _ info ^ (.(.PHP )/. ) $;

fastcgi _ param script _ filename $ document _ root $ fastcgi _ script _ name;

fastcgi _ param path _ info $ fastcgi _ path _ info;

fastcgi _ param path _ translated $ document _ root $ fastcgi _ path _ info;

include fastcgi_params;

}

}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。