nginx+tomcat 502 bad gateway

nginx能收到80请求,但是无法转到tomcat:8080.
直接访问http://x.x.x.x:8080/project 可以访问
查看/var/log/nginx/error.log发现:

2017/05/25 15:29:03 [crit] 5543#5543: *1 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: 192.168.61.16, server: , request: “GET /java/ HTTP/1.1”, upstream: “http://127.0.0.1:8080/java/”, host: “192.168.61.134”

原来一条命令可以解决:

/usr/sbin/setsebool -P httpd_can_network_connect true

发表评论

电子邮件地址不会被公开。 必填项已用*标注