Locations are evaluated in this order:
location = /path/file.ext {}
Exact matchlocation ^~ /path/ {}
Priority prefix match -> longest firstlocation ~ /Paths?/ {}
(case-sensitive regexp) and location ~* /paths?/ {}
(case-insensitive regexp) -> first matchlocation /path/ {}
Prefix match -> longest firstThe priority prefix match (number 2) is exactly as the common prefix match (number 4), but has priority over any regexp.
For both prefix matche types the longest match wins.
Case-sensitive and case-insensitive have the same priority. Evaluation stops at the first matching rule.
Documentation says that all prefix rules are evaluated before any regexp, but if one regexp matches then no standard prefix rule is used. That's a little bit confusing and does not change anything for the priority order reported above.