-
NGINX > regex des locations
locationpermet une redirection au niveau du système. Si aucune meilleur correspondance, il sera utilisé comme résultat.
location [modifier] [URL-match] { ... }
/
Toute requête
location / {...}
/…/
Toute requête commençant par /images/
location /images/ {
=
exactly match the requested prefix path and then stop searching for better matches.
location = /imgs {
OUI :
mydomain.com/imgsNON :
mydomain/imgs/index.html,mydomain/imgs/~
case-sensitive regex the requested URI and continuously searches for a better match.
location ~ /imgs {
~*
case-insensitive regex. However, any requests that send to the /imgs/ folder will be entertained by the previous location block.
location ~* .(png|ico|gif|jpg|jpeg|css|js)$ {
^~
case-sensitive regex match against the requested URL. Therefore, if the URI will be matched in the /imgs or /imgs/pico.png, it stops searching to find a better match.
location ^~ /imgs {
RELATED LINUX HINT POSTS