<p class="MsoNoSpacing">Bumping up and old thread.</p>
<p class="MsoNoSpacing">How can I ensure I don’t set rate limiting for my 404
pages with the scenario that maxim explained? </p>
<p class="MsoNoSpacing">My rate limiting is set to the whole site at / </p>- Quintin<br>
<br><br><div class="gmail_quote">On Thu, May 31, 2012 at 4:16 PM, Quintin Par <span dir="ltr"><<a href="mailto:quintinpar@gmail.com" target="_blank">quintinpar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Thanks Maxim. </p>
<p>Is there a way I can debug this? </p>
<p>This is for 404 and since there are no errors for 404’s
from my hunch this should be working. I use static for 500's </p>
<p>Also how do I exclude error pages form limits? Is there a
standard pattern? I do rate limiting
like this</p>
<p> limit_req_zone
$binary_remote_addr zone=pw:30m rate=20r/m;</p>
<p> location /
{</p>
<p> if (-f /var/www/statichtmls/build.html) {</p>
<p> return 503;</p>
<p> }</p>
<p> limit_req zone=pw burst=5 nodelay;</p>
<p>for the whole site. </p><span class="HOEnZb"><font color="#888888">- Quintin</font></span><div class="HOEnZb"><div class="h5"><br>
<br><br><div class="gmail_quote">On Fri, May 18, 2012 at 2:48 AM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<div><br>
On Thu, May 17, 2012 at 04:34:14PM -0700, Quintin Par wrote:<br>
<br>
> Hi all,<br>
><br>
> I have a 404 custom page set like this<br>
><br>
> error_page 404 = @errorpages;<br>
> error_page 500 = @errorpages;<br>
><br>
> location @errorpages {<br>
> root /var/www/;<br>
> internal;<br>
> proxy_pass <a href="http://localhost:82" target="_blank">http://localhost:82</a>;<br>
<br>
</div>[...]<br>
<div><br>
> }<br>
><br>
> But every now and then I am hitting the nginx vanilla 404 pages, especially<br>
> when hitting rate limiting.<br>
><br>
> How do I close the gaps to ensure I am showing only the custom 404’s ?<br>
<br>
</div>Most likely you are see double errors with 404 being the last<br>
one. By default nginx returns builtin error page in such cases,<br>
unless recursive_error_pages is set. (And it's not really good<br>
idea to change the default unless you understand what are you<br>
doing and sure it won't create loops.)<br>
<br>
I would recommend to<br>
<br>
a) use static files for error pages;<br>
<br>
b) make sure no limits are applied to error pages location.<br>
<br>
Maxim Dounin<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></blockquote></div><br>
</div></div></blockquote></div><br>