<div dir="ltr">I have setup nginx (1.9.5) as a proxy for few tomcat servers through proxy_pass directive. The proxy_pass points to a domain name (aws route53). The proxying works okay, but domain name is resolved only during nginx startup/reload. I have setup the resolver to force resolving domain name every few seconds, but it does not work. Here is my config. Any thoughts on why this does not work?<div><br></div><div><br><div><br></div><div><pre style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit">server {
listen 443;
server_name localhost;
ssl on;
resolver 10.0.0.2 valid=10s;
ssl_certificate /etc/nginx/certs/ssl-bundle3.crt;
ssl_certificate_key /etc/nginx/certs/chewie.key;
ssl_dhparam /etc/nginx/certs/dhparam.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 180m;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";
location / {
resolver_timeout 30s;
resolver <span style="white-space:inherit">10.0.0.2</span><span style="white-space:inherit"> valid=10s;</span><br> set $target "<a href="http://abctest.hello.world:80">http://abctest.hello.world:80</a>";
proxy_pass $target;
proxy_cache_bypass true;
proxy_no_cache true;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ssl_session_reuse on;
error_log /var/log/nginx/error.log debug;
}
}</code></pre></div></div></div>