<div dir="ltr"><div>I am using nginx/1.1.19 (Ubuntu 12.04.3).<br><br></div>I have 3 reverse proxies setup, like so:<br><br><br>server {<br> listen 80;<br> server_name <a href="http://ebatch.example.com">ebatch.example.com</a>;<br>
client_max_body_size 20m;<br><br> location / {<br> proxy_pass <a href="http://127.0.0.1:8000/">http://127.0.0.1:8000/</a>;<br> include /etc/nginx/proxy.conf;<br> }<br><br> location /static/ {<br>
alias /srv/<a href="http://ebatch.example.com/public_html/">ebatch.example.com/public_html/</a>;<br> autoindex on;<br> # expires 31d;<br> }<br> <br> access_log /srv/<a href="http://ebatch.example.com/logs/static_access.log">ebatch.example.com/logs/static_access.log</a>;<br>
error_log /srv/<a href="http://ebatch.example.com/logs/static_error.log">ebatch.example.com/logs/static_error.log</a>;<br>}<br><br><div>server {<br> listen 80;<br> server_name <a href="http://capture.example.com">capture.example.com</a>;<br>
client_max_body_size 20m;<br><br> location / {<br> proxy_pass <a href="http://127.0.0.1:8001/">http://127.0.0.1:8001/</a>;<br> include /etc/nginx/proxy.conf;<br> }<br><br> location /static/ {<br>
alias /srv/<a href="http://capture.example.com/public_html/">capture.example.com/public_html/</a>;<br> autoindex on;<br> expires 31d;<br> }<br> <br> access_log /srv/<a href="http://capture.example.com/logs/static_access.log">capture.example.com/logs/static_access.log</a>;<br>
error_log /srv/<a href="http://capture.example.com/logs/static_error.log">capture.example.com/logs/static_error.log</a>;<br>}<br><br>server {<br> listen 80;<br> server_name <a href="http://production.example.com">production.example.com</a>;<br>
client_max_body_size 20m;<br><br> location / {<br> proxy_pass <a href="http://127.0.0.1:8003/">http://127.0.0.1:8003/</a>;<br> include /etc/nginx/proxy.conf;<br> }<br><br> location /static/ {<br>
alias /srv/<a href="http://production.example.com/public_html/">production.example.com/public_html/</a>;<br> autoindex on;<br> # expires 31d;<br> }<br> <br> access_log /srv/<a href="http://production.example.com/logs/static_access.log">production.example.com/logs/static_access.log</a>;<br>
error_log /srv/<a href="http://production.example.com/logs/static_error.log">production.example.com/logs/static_error.log</a>;<br>}<br><br><br></div><div>Only the paths differ in each setup. The first two works 100%. While the last one gives me a bad gateway error. When I connect to <a href="http://production.example.com/static/">production.example.com/static/</a> <br>
</div><div>I get served the files from <a href="http://capture.example.com/static/">capture.example.com/static/</a>. And no log entries get written to /srv/production/logs/* <br><br></div><div>I can confirm that the upstream server is working correctly.<br>
</div><div>Both lynx <a href="http://127.0.0.1:8003">http://127.0.0.1:8003</a> return the correct results<br></div><div>and when I change the server to<br><br> python -m SimpleHTTPServer 8003 <br><br>I still get a bad gateway.<br>
<br></div><div>Any help would be much appreciated. <br></div><div><br></div><div>Regards, Louis.<br></div><div><br></div><div>-- <br>Louis Cordier <br><div>cell: +27721472305
</div></div></div>