NGinX cannot connect to Jenkins on CentOS 7

vharavy picture vharavy · Sep 23, 2014 · Viewed 9.3k times · Source

I have installed Jenkins CI on Cent OS 7 machine as well as NGinX and configured reverse proxy as outlined in the document. I can connect to Jenkins via port 8080, but cannot via port 80. I see the following error in /var/log/nginx/error.log:

2014/09/22 22:12:35 [crit] 1639#0: *4 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: 10.10.81.212, server: 10.10.81.82, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "10.10.81.82"

Does anyone has any idea what causes the problem?

P.S. I used the similar setup on CentOS 6.4 and everything was fine.

Answer

vharavy picture vharavy · Sep 23, 2014

It seemed to be a SELinux related problem. As suggested in this question I have tried using

setsebool -P httpd_can_network_connect 1

and everything works fine after that.