Weird bad gateway issues

Louis Cordier lcordier at gmail.com
Mon Feb 24 15:21:36 UTC 2014


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.

-- 
Louis Cordier
cell: +27721472305
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140224/5cf25a99/attachment-0001.html>


More information about the nginx mailing list