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;
It’s done, just replace $host with the domain name