Welcome! Log In Create A New Profile

Advanced

Weird bad gateway issues

Louis Cordier
February 24, 2014 10:22AM
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
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Weird bad gateway issues

Louis Cordier February 24, 2014 10:22AM

Re: Weird bad gateway issues

Louis Cordier February 24, 2014 10:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready