Nginx location matches
location = /abc {} matches the exact uri /abc location ~ /abc is a regex match on the uri, meaning any uri containing /abc, you probably want: location ~ ^/abc for the uri begining with /abc instead
location = /abc {} matches the exact uri /abc location ~ /abc is a regex match on the uri, meaning any uri containing /abc, you probably want: location ~ ^/abc for the uri begining with /abc instead
Nginx location: Nginx location block section have a search order, a modifier, an implicit match type and an implicit switch to whether stop the search on match or not. the following array describe it for regex. # ——————————————————————————————————————————————– # Search-Order Modifier Description Match-Type Stops-search-on-match # ——————————————————————————————————————————————– # 1st = The URI must match the specified …
Try location ~ ^/(first/location|second/location)/ { … } The ~ means to use a regular expression for the url. The ^ means to check from the first character. This will look for a / followed by either of the locations and then another /.