How can rewrite rules exclude specific paths?
For example, the entire site uses HTTPS, but /XXX/ does not use HTTPS
By rewriting ^(.*) https://$host$1 permanent; you can all jump to the https address, but among them http What should I do if I don’t want to force HTTPS for all content at ://abc.com/XXX/? Because some clients do not support HTTPS, they cannot all be banned at once.
某草草2017-05-16 17:09:55
Just put it in front, refer to the code
location /XXX/ {
index index.php;
}
location / {
rewrite ^(.*) https://$host permanent;
}
我想大声告诉你2017-05-16 17:09:55
First use location to exclude the exception path, and then do rewrite.