Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: Negated Regular Expressions in location

$
0
0
Johann, you are very welcome and I am happy to open you the world of perl regex assertions, but in spite of your original question this should not be a problem because of the order locations are defined and processed. See http://nginx.org/en/docs/http/request_processing.html for the rules about location/request processing order.

So if you define:

location = /favicon.ico {
// need to include something here.
}

location /resources/ {
// need to include something here.
}

location = /robots.txt {
// need to include something here.
}

location ~ ^/ {
proxy_pass http://tomcat3;
}

Then "location ~ ^/" will only capture requests that do not match those specific locations defined above "location /" (with no regex).

Andrejs
loco (at) andrews.lv

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>