gpt4 book ai didi

php - 将单页 https 重写为 http Nginx

转载 作者:可可西里 更新时间:2023-10-31 22:07:14 24 4
gpt4 key购买 nike

我想将“https://www.example.com”和“https://example.com”重写为“http://www.example.com”或“http://example.com”分别'。我只想写网站的特定部分,而不是任何子文件夹或 php 相关页面。我该怎么做?

最佳答案

我在另一个方向上使用它(没有在这个方向上测试但应该工作)。

if ( $scheme = https )
{
rewrite ^ http://$host$uri;
}

编辑:限制到一个位置并结束不要尝试重写更多:

location / {
if ( $scheme = https )
{
rewrite ^ http://$host$uri last;
}
}

关于php - 将单页 https 重写为 http Nginx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5056774/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com