• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Bad gateway error Nginx on websites

LaurentR2D2

Plesk Certified Professional
Plesk Certified Professional
Hello,

I've migrated Plesk 12.5 and the websites I host on a server with Centos 7. I've used Security Advisor to add Let's encrypt certificates to my domains and to the server, enable Nginx proxy and HTTP/2, and Datagrid reliability and vulnerability scanner. It seemed to work fine at the beginning, but today I've found that all the websites were displaying a "502 bad gateway error - nginx" instead of the homepage. I've followed the instructions from this kb article :

https://kb.plesk.com/en/123735

but the error was still there. I've finally disabled nginx to get access to the websites. Is there another way to fix this problem ? The only error I see in the error log of nginx is :

Code:
2016/09/02 18:48:13 [error] 2775#0: *2899 connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: , request: "GET / HTTP/1.1", upstream: "http://x.x.x.x:7080/", host: "x.x.x.x"

Is Nginx really needed on a server with low trafic websites ? I've read it was made for a high trafic website at the beginning. Concerning http/2, can't I wait to have Apache support it before I activate it ?

Thank you
 
Are you using fail2ban? In that case you need to exclude 127.0.0.1 from the jails. Else Nginx will be blocked by fail2ban because it accesses Apache too frequently.
 
Are you using fail2ban? In that case you need to exclude 127.0.0.1 from the jails. Else Nginx will be blocked by fail2ban because it accesses Apache too frequently.

It's already excluded from the jails. 127.0.0.1/8 is in the trusted ip adresses list.

The IP address of my server is banned by the plesk-apache-badbot jail. Is there something to do with nginx ? Should I move my server ip address in the trusted ip list for this jail ?
 
Last edited:
Yes, you must definitely exclude all local addresses from jails, else Nginx will not be served by Apache. The error message you are getting is saying that Apache refuses to deliver data to Nginx. As Apache is running, this refusal is most likely for the reason that your local IP is blocked.
 
Thank you. It works fine now. Doing what you said has also solved a problem of Plesk not being able to display the shared files :)
 
Back
Top