nginx directives geo and map behind proxy

gogan nginx-forum at forum.nginx.org
Mon Mar 18 13:49:05 UTC 2019


Francis Daly Wrote:
-------------------------------------------------------

> geo $limited {
>   default 0;
>   x.x.x.x 1;
> }    
>  
> map $limited $botlimit {
>   1 '';
>   0 $remote_addr;
> }
 
> That config says that requests with $remote_addr set to x.x.x.x should
> not be limited, and everything else should be limited.

Yes, this is how it should work.

> Does myracloud set the Cloudflare header?

Yes.

> and make some requests for /iptest, which lines show the address
> x.x.x.x
> and which lines show the real client IP address?
> 

With myracloud CF-Connecting-IP and remote_addr are set to client ip and
real remote is myracloud ip. botlimit is set to remote_addr in general and
to x.x.x.x if hits in geo given ip address. So far as I expected and now it
works. I don't know why, but I have a better understanding because of your
help, thanks!

A trifle still ... is set 

limit_req_status 429;
limit_conn_status 429;

But in access.log I get 503, why?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,283352,283416#msg-283416



More information about the nginx mailing list