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.
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.