当前位置:Gxlcms > PHP教程 > nginx代理tomcat502badgateway

nginx代理tomcat502badgateway

时间:2021-07-01 10:21:17 帮助过:15人阅读

nginx能收到80请求,但是无法转到tomcat:8080.

直接访问http://x.x.x.x:8080/project 可以访问

查看/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"

解决方案:

http://stackoverflow.com/questions/25235453/nginx-proxy-server-localhost-permission-denied

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

版权声明:本文为博主原创文章,未经博主允许不得转载。

以上就介绍了nginx 代理 tomcat 502 bad gateway,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

人气教程排行