Reverse Proxy with 500k connections

larsg nginx-forum at forum.nginx.org
Thu Mar 9 14:52:13 UTC 2017


Thanks for the advice.
I implemented this approach. Unfortunately not with 100% success.

When enabling sysctl option "net.ipv4.ip_nonlocal_bind = 1" it is possible
to use local IP addresses (192.168.1.130-139) as proxy_bind address.
But than using such an address (other than 0.0.0.0), nginx will produce an
error message.
Interesting aspect is: attribute "server" in the log entry is empty. 
When using 0.0.0.0 as proxy_bind, everything is fine.

Do you have any ideas?

2017/03/09 14:27:09 [crit] 69765#0: *478633 connect() to 192.168.1.21:443
failed (22: Invalid argument) while connecting to upstream, client: x.x.x.x,
server: , request: "GET /myservice HTTP/1.1", upstream:
"https://192.168.1.21:443/myservice", host: "xxxxxxx:44301"

split_clients "${remote_addr}AAAA" $proxy_ip {
     # does not work 
     100% 192.168.1.130;
     
     # works
     100% 0.0.0.0;
}

server {
  listen              44301 ssl backlog=163840;
  #works
  #proxy_bind          0.0.0.0;
  
  #does not work
  #proxy_bind 192.168.1.130;
  
  proxy_bind $proxy_ip;

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



More information about the nginx mailing list