Nginx location matches

NginxNginx Location

Nginx Problem Overview


What is the difference between:

 location = /abc {}

and

 locaton ~ /abc {}

Nginx Solutions


Solution 1 - Nginx

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser650505View Question on Stackoverflow
Solution 1 - NginxMartin RedmondView Answer on Stackoverflow