Weird bad gateway issues

I am using nginx/1.1.19 (Ubuntu 12.04.3).

I have 3 reverse proxies setup, like so:

server {
listen 80;
server_name ebatch.example.com;
client_max_body_size 20m;

location / {
    proxy_pass http://127.0.0.1:8000/;
    include /etc/nginx/proxy.conf;
}

location /static/ {
    alias   /srv/ebatch.example.com/public_html/;
    autoindex on;
    # expires 31d;
}

access_log  /srv/ebatch.example.com/logs/static_access.log;
error_log   /srv/ebatch.example.com/logs/static_error.log;

}

server {
listen 80;
server_name capture.example.com;
client_max_body_size 20m;

location / {
    proxy_pass http://127.0.0.1:8001/;
    include /etc/nginx/proxy.conf;
}

location /static/ {
    alias   /srv/capture.example.com/public_html/;
    autoindex on;
    expires 31d;
}

access_log  /srv/capture.example.com/logs/static_access.log;
error_log   /srv/capture.example.com/logs/static_error.log;

}

server {
listen 80;
server_name production.example.com;
client_max_body_size 20m;

location / {
    proxy_pass http://127.0.0.1:8003/;
    include /etc/nginx/proxy.conf;
}

location /static/ {
    alias   /srv/production.example.com/public_html/;
    autoindex on;
    # expires 31d;
}

access_log  /srv/production.example.com/logs/static_access.log;
error_log   /srv/production.example.com/logs/static_error.log;

}

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
production.example.com/static/
I get served the files from capture.example.com/static/. And no log
entries
get written to /srv/production/logs/*

I can confirm that the upstream server is working correctly.
Both lynx http://127.0.0.1:8003 return the correct results
and when I change the server to

python -m SimpleHTTPServer 8003

I still get a bad gateway.

Any help would be much appreciated.

Regards, Louis.

On Mon, Feb 24, 2014 at 5:21 PM, Louis C. [email protected]
wrote:

When I connect to production.example.com/static/ I get served the files
from capture.example.com/static/.

You can ignore this part, looks like browser caching.