简体   繁体   English

如何对整个站点(nginx / 1.4.6服务器)从https重定向到http进行301重定向

[英]How to make a 301 redirect from https to http for the whole site (nginx/1.4.6 server)

I am very very sorry if i asked a stupid question)) I am an SEO analyst and i have to give my boss a code which will be used to redirect visitors from https to http version of the website. 如果我问一个愚蠢的问题,我感到非常抱歉。)我是一名SEO分析师,我必须给我的老板一个代码,该代码将用于将访问者从https重定向到网站的http版本。

Please give me the example of the code/scipt 请给我示例代码/密码

Thanks, Stan 谢谢,斯坦

This is more a question for serverfault. 这更多是关于服务器故障的问题。

They have this answer for the other way around. 相反,他们有这个答案。

for you something like: 对你来说:

server {
       listen         80;
       server_name    my.domain.com;
       [....]
}

server {
       listen         443;
       server_name    my.domain.com;
       rewrite        ^ http://$server_name$request_uri? permanent;

       ssl            on;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM