<div dir="ltr"><font face="monospace, monospace">Hello everyone.</font><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">I'm trying to setup an Nginx proxy on AWS EC2 with the following general layout:</font></div><div><br></div><div><font face="monospace, monospace"><a href="http://mydomain.com">mydomain.com</a> > ELB > EC2 Nginx > App's Beanstalk ELB</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">My first configuration was something like this:</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><div>http {</div><div>  upstream app {</div><div>    server <a href="http://current-app.elasticbeanstalk.com">current-app.elasticbeanstalk.com</a> weight 5;</div></font><div style="font-family:monospace,monospace">    server <a href="http://new-app.elasticbeanstalk.com">new-app.elasticbeanstalk.com</a> weight 1;</div><font face="monospace, monospace"><div>  }</div><div><br></div><div>  server {</div><div>    listen 80;</div><div><br></div><div>    location / {</div><div>      proxy_pass <a href="http://app">http://app</a>;</div><div>    }</div><div>  }</div><div>}</div><div><br></div><div>But it stopped working twice so far at around the same time after about one or two days. After reading more about that setup I found some suggestions about what could be going on:</div><div><br></div><div><a href="http://ghost.thekindof.me/nginx-aws-elb-dns-resolution-nginx-resolver-directive-and-black-magic/">http://ghost.thekindof.me/nginx-aws-elb-dns-resolution-nginx-resolver-directive-and-black-magic/</a><br></div><div><a href="https://stackoverflow.com/questions/26956979/error-with-ip-and-nginx-as-reverse-proxy">https://stackoverflow.com/questions/26956979/error-with-ip-and-nginx-as-reverse-proxy</a><br></div><div><a href="http://gc-taylor.com/blog/2011/11/10/nginx-aws-elb-name-resolution-resolvers/">http://gc-taylor.com/blog/2011/11/10/nginx-aws-elb-name-resolution-resolvers/</a><br></div><div><a href="http://forum.nginx.org/read.php?2,255961,255961#msg-255961">http://forum.nginx.org/read.php?2,255961,255961#msg-255961</a><br></div><div><br></div><div>Is it still necessary to use variables to force Nginx to resolve? If yes, to use upstream should I set the servers as variables or adding $request_uri will do the trick?</div><div><br></div><div>Bye!</div><div><br></div></font></div></div>