Nginx 404 showing when I configured for a custom 404 page

Quintin Par quintinpar at gmail.com
Sat Jun 23 16:10:10 UTC 2012


Bumping up and old thread.

How can I ensure I don’t set rate limiting for my 404 pages with the
scenario that maxim explained?

My rate limiting is set to the whole site at /
- Quintin


On Thu, May 31, 2012 at 4:16 PM, Quintin Par <quintinpar at gmail.com> wrote:

> Thanks Maxim.
>
> Is there a way I can debug this?
>
> 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
>
> Also how do I exclude error pages form limits? Is there a standard
> pattern?  I do rate limiting like this
>
>    limit_req_zone $binary_remote_addr zone=pw:30m rate=20r/m;
>
>         location / {
>
>                     if (-f /var/www/statichtmls/build.html) {
>
>                 return 503;
>
>             }
>
>                     limit_req zone=pw burst=5 nodelay;
>
> for the whole site.
> - Quintin
>
>
>
> On Fri, May 18, 2012 at 2:48 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
>
>> Hello!
>>
>> On Thu, May 17, 2012 at 04:34:14PM -0700, Quintin Par wrote:
>>
>> > Hi all,
>> >
>> > I have a 404 custom page set like this
>> >
>> >         error_page  404        = @errorpages;
>> >         error_page  500        = @errorpages;
>> >
>> >         location @errorpages {
>> >                     root /var/www/;
>> >                     internal;
>> >                     proxy_pass http://localhost:82;
>>
>> [...]
>>
>> >         }
>> >
>> > But every now and then I am hitting the nginx vanilla 404 pages,
>> especially
>> > when hitting rate limiting.
>> >
>> > How do I close the gaps to ensure I am showing only the custom 404’s ?
>>
>> Most likely you are see double errors with 404 being the last
>> one.  By default nginx returns builtin error page in such cases,
>> unless recursive_error_pages is set.  (And it's not really good
>> idea to change the default unless you understand what are you
>> doing and sure it won't create loops.)
>>
>> I would recommend to
>>
>> a) use static files for error pages;
>>
>> b) make sure no limits are applied to error pages location.
>>
>> Maxim Dounin
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120623/fe173f81/attachment.html>


More information about the nginx mailing list