Detailed explanation of Nginx's matching rules for location

The matching order of location is "regular first, then normal".

The execution logic of the location has nothing to do with the editing order of the location.

(1) When "^~" is specified in front of the normal location, it specifically tells Nginx that once the normal location matches, it does not need to continue regular matching;
(2) When the normal location happens to be strictly matched, not the largest prefix match, it will not be matched any longer. Continue to match the regex.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325063936&siteId=291194637
Recommended