Quantcast
Channel: Nginx Forum - Other discussion
Viewing all articles
Browse latest Browse all 972

Re: limit_req does not work

$
0
0
The limit_req happens at a later phase of query processing than the rewrite. So when you do the /test and /somesite the rewrite happens before limit. The URL the rewrite is targeting is not exactly '/' so the middle location isn't getting hit by the rewrite either to limit there. I suspect what you want is:

location = /test {
rewrite ^(.*)$ /test.txt;
}

location / {
limit_req zone=myzone burst=3 nodelay;
index lala.html;
}

location ~ /somesite {
rewrite ^(.*)$ /somesite.txt;
}

Viewing all articles
Browse latest Browse all 972


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