首頁  >  文章  >  後端開發  >  nginx 代理 tomcat 502 bad gateway

nginx 代理 tomcat 502 bad gateway

WBOY
WBOY原創
2016-07-29 09:15:452261瀏覽

nginx能收到80請求,但是無法轉到tomcat:8080.

直接訪問http://x.x.x.x:8080/project 可以訪問

查看/var/log/nginx/error.log

查看/var/log/nginx/error.log


2015/04 01 11:38:13 [crit] 2895#0: *10 connect() 至 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: 10.12.70.206, connecting to upstream, client: 10.12.70.206, server80 rehost: "GET /bpp HTTP/1.1", upstream: "http://127.0.0.1:8080/app", host: "10.11.202.204"

解:

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

I was able to find a solution after 2 days of searching. Somehow SELinux was permitting Nginx to proxy to my server. Running the command below fed the commandm.意思 /usr/sbin/setsebool -P httpd_can_network_connect true

版權聲明:本文為博主原創文章,未經博主允許不得轉載。 以上就介紹了nginx 代理 tomcat 502 bad gateway,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn