Nginx Proxy Tomcat 502 Bad Gateway

Source: Internet
Author: User
Nginx can receive 80 requests, but cannot go to tomcat:8080.

Direct access to Http://x.x.x.x:8080/project can be accessed

View/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 "

Solution:

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 is not permitting Nginx to proxy to my server. Running the command below fixed the issue.

-p permanent meaning

/usr/sbin/setsebool-p httpd_can_network_connect true

Copyright notice: This article is for Bo Master original text Not allowed to be reproduced without the permission of the Bo master.

The above describes the Nginx agent Tomcat 502 Bad Gateway, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.