Welcome! Log In Create A New Profile

Advanced

Re: Unable to use custom variable with limit_conn_zone

Valentin V. Bartenev
September 27, 2014 03:58PM
On Saturday 27 September 2014 14:24:00 paulswansea wrote:
> I am trying to use the limit connections / limit request. I have the server
> behind a proxy, the proxy has the following line :
>
> proxy_set_header X-Real-IP $remote_addr;
>
> and in my nginx.conf on my server behind the proxy i have :
>
> limit_conn_zone $http_x_real_ip zone=perip:10m;
> limit_conn perip 20;
> limit_req_zone $http_x_real_ip zone=forward:10m rate=60r/m;
>
> However, when checking my logs, I get the internal address of the proxy
> server listed, not the external real ip :
>
> 2014/09/27 13:45:16 [error] 57287#0: *29475 limiting requests, excess:
> 30.536 by zone "forward", client: 10.120.23.133
>
> Can you see an issue with my configuration, or is there a bug with nginx in
> respect to using custom variables?
>
[..]

IPs in log messages don't related to variable from limit zone.
So there's no problem. But if you want to see IP from the
header in logs, then you should configure the realip module:
http://http://nginx.org/en/docs/http/ngx_http_realip_module.html

wbr, Valentin V. Bartenev

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

Unable to use custom variable with limit_conn_zone

paulswansea September 27, 2014 02:24PM

Re: Unable to use custom variable with limit_conn_zone

Valentin V. Bartenev September 27, 2014 03:58PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
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