https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms
http://nginx.org/en/docs/http/ngx_http_core_module.html#location
location [ = | ~ | ~* | ^~ ] uri { ... }
location @name { ... }
(none) : prefix matching= : exact matching~ : case-sencitive matching~* : case-insensitive matching^~ : non-regular expressing matching@ : defines a named locationlocation = / {
[ configuration A ]
}
location / {
[ configuration B ]
}
location /documents/ {
[ configuration C ]
}
location ^~ /images/ {
[ configuration D ]
}
location ~* \\.(gif|jpg|jpeg)$ {
[ configuration E ]
}
/ → configuration A
/index.html → configuration B/document/document.html → configuration C/images/1.gif → configuration D/document/1.gif → configuration E