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.
Just put it in front, refer to the code
First use location to exclude the exception path, and then do rewrite.