Welcome! Log In Create A New Profile

Advanced

Re: Limit request + whitelist = not using response code from backend? 0.8.54

Anonymous User
February 19, 2013 08:36AM
Worked perfect! Thanks again.


On Tue, 19 Feb 2013, Maxim Dounin wrote:

> Hello!
>
> On Tue, Feb 19, 2013 at 02:05:46PM +0100, DreamWerx wrote:
>
>> Hi all,
>>
>> I'm hoping someone can help me with a small issue. I'm trying to
>> implement rate limiting with a whitelist, and all in all it seems to
>> be working, but
>> the wrong response code is being sent back to the browser.
>>
>> For example if the apache backend sends a 302 redirect response, nginx
>> still sends a 200 back? If I remove the mapping to code 200, it then
>> sends a 418 back.
>> Is there an easy fix for this?
>
> Yes,
>
> - error_page 418 =200 @limitclient;
> + error_page 418 = @limitclient;
>
> See http://nginx.org/r/error_page.
>
> Alternatively, you may want to use something like
>
> geo $limited { ... }
>
> map $limited $address {
> 1 $binary_remote_address;
> 0 "";
> }
>
> limit_req_zone $address zone=...;
>
> to implement a whitelist (i.e., make sure the variable used in
> limit_req_zone is empty if you don't want the limit).
>
> --
> Maxim Dounin
> http://nginx.com/support.html
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Limit request + whitelist = not using response code from backend? 0.8.54

DreamWerx February 19, 2013 08:06AM

Re: Limit request + whitelist = not using response code from backend? 0.8.54

Maxim Dounin February 19, 2013 08:20AM

Re: Limit request + whitelist = not using response code from backend? 0.8.54

Anonymous User February 19, 2013 08:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 180
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready