nginx directives geo and map behind proxy

gogan nginx-forum at
Tue Mar 12 10:22:30 UTC 2019

We have a problem with mapping ip's on our nginx loadbalancer behind
myracloud (proxy). In configuration file we have:

set_real_ip_from x.x.x.x
real_ip_header   CF-Connecting-IP;
real_ip_recursive on;

In addition to map ip's:

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

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

We want to limit requests with limit_req_zone in gninx. Using it directly
connected to the loadbalancer is fine. It works great, but connections
coming from myracloud are not limited. Guess nginx is evaluating ip address
before extracting real client ip from proxy. So, is there a way to solve the

Posted at Nginx Forum:,283352,283352#msg-283352

More information about the nginx mailing list