Nginx Location Match Rules
Created On: 2014-06-10
Location is used in nginx config file to map a request URI to a config block.
Brief listing of different type of matches:
- = exact match
- ~ regexp match, case-sensitive (~* is case-insensitive)
- ^~ high priority prefix match
- [nothing] regular prefix match
Priority from highest to lowest is
- = match
- longest prefix match using the ^~ operator
- in the order the config file is written, the first regexp match
- longest prefix match
Official document is in nginx location syntax, but I often find it confusing.