Welcome! Log In Create A New Profile

Advanced

nginx/0.8.54 - 502 Bad Gateway

July 20, 2011 09:43AM
Hi,

I'm running nginx as a reverse proxy for a jetty. I host a Liftweb App on localhost:8080. Nginx is listening on Port 81.

Here is my nginx.conf:

server {
listen 81;
server_name mysite.com www.mysite.com;

location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 700;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

When I try to point my browser to mysite.com:81 I always get a 502 Bad Gateway message. I checked the log and found this:

connect() failed (111: Connection refused) while connecting to upstream, client: 12.34.567.890, server: mysite.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "mysite.com:81"

Does this means this port is blocked? I tried other but the result is still the same...

My hosting company gave me the advice better not to use port 80 (i'm in china) and use some socket instead. I don't know what they mean by that. I use port 81 for nginx now. Anyone an idea what they could mean by "use sockets"? I read somewhere that i can later forward all traffic from 81 to port 80.

Any hints a very much appreciated.
Thanks.
Subject Author Posted

nginx/0.8.54 - 502 Bad Gateway

nginxn00b July 20, 2011 09:43AM

Re: nginx/0.8.54 - 502 Bad Gateway

António P. P. Almeida July 20, 2011 12:00PM

Re: nginx/0.8.54 - 502 Bad Gateway

nginxn00b July 20, 2011 12:18PM

Re: nginx/0.8.54 - 502 Bad Gateway

Reinis Rozitis July 20, 2011 12:28PM

Re: nginx/0.8.54 - 502 Bad Gateway

Adam Tucker July 20, 2011 12:40PM

Re: nginx/0.8.54 - 502 Bad Gateway

Adam Tucker July 20, 2011 12:40PM

Re: nginx/0.8.54 - 502 Bad Gateway

nginxn00b July 21, 2011 12:40AM

Re: nginx/0.8.54 - 502 Bad Gateway

Antoine Bonavita July 21, 2011 03:08AM

Re: nginx/0.8.54 - 502 Bad Gateway

nginxn00b July 21, 2011 05:10AM

Re: nginx/0.8.54 - 502 Bad Gateway

Antoine Bonavita July 21, 2011 06:02AM

Re: nginx/0.8.54 - 502 Bad Gateway

nginxn00b July 21, 2011 08:06AM

Re: nginx/0.8.54 - 502 Bad Gateway

Antoine Bonavita July 22, 2011 03:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 117
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready