nginx能收到80请求,但是无法转到tomcat:8080.
查看/var/log/nginx/error.log
2015/04/01 11:38:13 [crit] 2895#0: *10 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: 10.12.70.206, server: localhost:8080, request: "GET /bpp HTTP/1.1", upstream: "http://127.0.0.1:8080/app", host: "10.11.202.204"
解决方案:
I was able to find a solution after 2 days of searching. Somehow SELinux was not permitting Nginx to proxy to my server. Running the command below fixed the issue.
-P permanent的意思
/usr/sbin/setsebool -P httpd_can_network_connect true