User Tools

Site Tools


nginx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
nginx [2026/01/08 00:02] lexnginx [2026/01/08 00:39] (current) lex
Line 15: Line 15:
 ''~*'' Regex, case insensitive\\ ''~*'' Regex, case insensitive\\
 ''^~'' Prefix match without following regex\\ ''^~'' Prefix match without following regex\\
-== Logic ==+=== Logic ===
 Nginx divides it into prefix locations and regex locations. It starts going through prefix locations, selecting the longest that matches. With that selection, nginx runs through the regex matches. If ''='' or ''^~'' is used, regex matching won't be done. Nginx divides it into prefix locations and regex locations. It starts going through prefix locations, selecting the longest that matches. With that selection, nginx runs through the regex matches. If ''='' or ''^~'' is used, regex matching won't be done.
  
 +=== Examples ===
  
 <code> <code>
     location / {     location / {
-        root /data/www; 
     }     }
 </code> </code>
-refers to the URI, so in this case the root URI\\ +Matches with ''http://someweb.site/'' and any address proceeding the ''/'', so it also matches ''http://someweb.site/cool/resource''.
-So the above returns files in ''/data/www''+
  
 <code> <code>
     location /images/ {     location /images/ {
-        root /data; 
     }     }
 </code> </code>
-Returns files in /data/images/+Matches with ''http://someweb.site/images'' and any address proceeding the ''/images'', so it also matches ''http://someweb.site/cool/resource''.
  
 <code> <code>
nginx.1767830567.txt.gz · Last modified: by lex

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki