Questions about proxy_pass and internal directives

mrtn nginx-forum at nginx.us
Thu Oct 18 22:18:18 UTC 2012


Hello Reinis,

Thanks for pointing that out. Just to make sure I understand the doc
correctly for my case.

Given that: location /foo/bar/ (directive with conventional strings) and
location ~* (\.jpg|\.png|\.css|\.js|\.html)$ (regular expressions). The
/foo/bar/ location is actually checked and matched first, however, since I
don't have a '^~' prefix in front of /foo/bar/, the search continues with
regex match and matches with location ~* (\.jpg|\.png|\.css|\.js|\.html)$.
In the end, it is the regex location directive that is used by nginx.

So to correct the problem, I simply need to add a prefix '^~' in front of
/foo/bar/ to stop the search once matched.

Please correct me if I get anything wrong. Thanks.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,231998,232005#msg-232005



More information about the nginx mailing list