Posted
Filed under centos7

[원문] http://boredguy.net/how-to-fix-nginx-502-bad-gateway-error-on-centosrhel/

포워딩이 정상적으로 톰켓으로 전달이 안되는 경우

다음과 같은방법으로 해결 가능 하다.

How to fix nginx 502 Bad Gateway error on CentOS/RHEL

I was trying to set up a reverse proxy for Atlassian Jira and Confluence by using nginx, connected to http://localhost:8080. This is the error I was getting in my logs:

2015/02/10 10:59:37 [crit] 21155#0: *12 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: a.b.c.d, server: x.y.z, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "x.y.z"
2015/02/10 10:59:38 [error] 21155#0: *15 no live upstreams while connecting to upstream, client: a.b.c.d, server: x.y.z, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "x.y.z"

Turns out it was just a SELinux issue. I’ve fixed the problem by issuing this command:

setsebool -P httpd_can_network_connect 1

If you want, you can even completely disable SELinux this way:

sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
This entry was posted in Atlassian, CentOS, nginx.
2015/05/08 01:34 2015/05/08 01:34