Home >Backend Development >PHP Tutorial >Detailed explanation of nginx location priority location nginx nested location nginx path nginx location roo
There are several types of location in
nginx:
1. Prefix, which can be modified with = or ^~, such as
location / /
location /img/ starting with /
location = /a.htm starting with /img/ /a.htm
location ^~ /d No longer checks the regular expression location after matching
2. Regular expression, fixed at the beginning of ~ or ~* (not case-sensitive), such as:
location ~ .html$
location ~* .gif$
When there are multiple locations at the same time, the priority is as follows:
1.Test the URI against all prefix strings.
Compare with all prefixesIf there is no regular match, use the longest prefix just now
The above introduces the detailed explanation of nginx location priority, including location and nginx content. I hope it will be helpful to friends who are interested in PHP tutorials.