Welcome! Log In Create A New Profile

Advanced

Re: nginx directives geo and map behind proxy

March 15, 2019 10:34AM
Hi,

thanks for the response.

I try it with a short view.


Situation 1)

Proxy (external, myracloud) <--- Connect official way
|
LB/Proxy (internal)
|
w-1 w-2 w-3 .. w10

Situation 2)

LB/Proxy (internal) <--- directly connect
|
w-1 w-2 w-3 .. w10


In both situations I see real client IP addresses in server log on webservers and proxy/loadbalancer.

In situation 1 traffic is general limited without exceptions.
In situation 2 traffic is limited as expected, all is fine.

====== server.conf=====

limit_req_zone $botlimit zone=req_limit_per_login:10m rate=4r/s;

...

location ~ ^(/userzentrum/login).*$ {
limit_req zone=req_limit_per_login;
proxy_pass xxx_application;
include /etc/nginx/proxy_params;
}

====nginx conf====

geo $limited {
default 0;
x.x.x.x 1;
}

map $limited $botlimit {
1 '';
0 $remote_addr;
}

...

# get x-real-ip from myracloud
set_real_ip_from x.x.x.x;

real_ip_header CF-Connecting-IP;
real_ip_recursive on;
Subject Author Posted

nginx directives geo and map behind proxy

gogan March 12, 2019 06:22AM

Re: nginx directives geo and map behind proxy

Francis Daly March 14, 2019 02:34PM

Re: nginx directives geo and map behind proxy

gogan March 15, 2019 10:34AM

Re: nginx directives geo and map behind proxy

Francis Daly March 16, 2019 05:34AM

Re: nginx directives geo and map behind proxy

gogan March 18, 2019 09:49AM

Re: nginx directives geo and map behind proxy

Francis Daly March 21, 2019 07:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready