nginx 502 Bad Gateway with NodeBB -
i 502 bad gateway when connecting nodebb installation using domain nodebb running on default port (4567)
my nginx seems configured (when connecting using ip): http://puu.sh/mli7u/0e03691d4c.png nodebb seems configured (when connecting using ip): http://puu.sh/mli95/5fdafcaed9.png record directing ip vps configured properly.
here etc/nginx/conf.d/example.com.conf
server { listen 80; server_name sporklounge.com; location / { proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_set_header x-nginx-proxy true; proxy_pass http://127.0.0.1:4567/; proxy_redirect off; # socket.io support proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; }
}
my nodebb config.json { "url": "http://localhost:4567", "secret": "25d0d6a2-0444-49dc-af0c-bd693f5829d8", "database": "redis", "redis": { "host": "127.0.0.1", "port": "6379", "password": "", "database": "0" } }
here var/log/nginx/error.log
2016/01/27 12:04:42 [error] 22026#0: *4062 upstream timed out (110: connection timed out) while reading response header upstream, client: 50.186.224.26, server: sporklounge.com, request: "get /favicon.ico http/1.1", upstream: "http://127.0.0.1:80/favicon.ico", host: "sporklounge.com", referrer: "http://sporklounge.com/" 2016/01/27 12:21:06 [crit] 974#0: *1 connect() 127.0.0.1:4567 failed (13: permission denied) while connecting upstream, client: 50.186.224.26, server: sporklounge.com, request: "get / http/1.1", upstream: "http://127.0.0.1:4567/", host: "sporklounge.com" 2016/01/27 12:21:07 [crit] 974#0: *1 connect() 127.0.0.1:4567 failed (13: permission denied) while connecting upstream, client: 50.186.224.26, server: sporklounge.com, request: "get /favicon.ico http/1.1", upstream: "http://127.0.0.1:4567/favicon.ico", host: "sporklounge.com", referrer: "http://sporklounge.com/"
all appreciated , answer questions can solution, thank you!
the 1 thing see according the docs, url
config value should full web-accessible address points nodebb. sporklounge.com
, not current value.
it backend responding slowly. try high values of value in nginx see if backend responds:
# testing, allow long response times. proxy_read_timeout 5m;
also, use netstat confirm backend running on port 4567:
sudo netstat -nlp | grep ':4567'
wait, answer may right in logs, give reason connection failure:
(13: permission denied) while connecting upstream
see related question:
Comments
Post a Comment