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.