I am trying to use nginx to pass an incoming connection to another server (the reason I am doing this -- the connection is coming in from a host that can't do DNS resolution, and the server that should ultimately receive the traffic needs to be resolved by DNS). I am using the following config:
stream {
resolver 127.0.0.1 valid=1s;
upstream server_us {
server server.foo.com:22222;
}
server {
listen 11111;
proxy_pass server_us;
}
}
I don't understand why the name resolution isn't expiring as specified by the "valid" directive. (i.e., if I change the IP for server.foo.com in /etc/hosts, nginx doesn't recognize the change). What am I doing wrong?