About the problem of Nginx forcing to jump to HTTPS
给我你的怀抱
给我你的怀抱 2017-05-16 17:08:12
0
1
377

I checked it on the Internet, and one of them said this:

Excuse me https://$host$1 permanent;What do $host$1 and permanent here mean?


I just checked on Baidu, $host is the requested host name, $1 is the first matching result, and permanent should be the permanent orientation.

But there are multiple servers in my conf file bound to different domain names. Will this affect the value of $host?


I just added this rewrite sentence to the configuration file. After reloading, HTTP did not jump to HTTPS. I will try to see what went wrong.


Done, just replace $host with the domain name

 rewrite ^(.*)$  https://www.test.com permanent; 
给我你的怀抱
给我你的怀抱

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!