• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Error 502 Bad Gateway no KB helped

SalvadorS

Regular Pleskian
Hello,

Today we have one of our servers (Plesk 12.5, Debian 8.3) with Error 502 Bad Gateway in all websites (control panel works fine). The error starts when the logs rotated this morning...

We followed KB articles to fix the issue with no results.

We re enable enginx, reconfigured the domains configurations, see logs... Nothing

Only we find this log on the proxy_error_log of the sites:

2016/02/15 09:50:30 [error] 6836#0: *22 connect() failed (111: Connection refused) while connecting to upstream, client: x.y.z.q, server: domain.com, request: "GET / HTTP/1.1", upstream: "http://a.b.c.d:7080/", host: "www.domain.com"

2016/02/15 09:52:00 [error] 8046#0: *150 connect() failed (111: Connection refused) while connecting to upstream, client: x.y.z.q, server: domain.com, request: "GET / HTTP/1.1", upstream: "http://a.b.c.d:7080/", host: "www.domain.com"


Where x.y.z.q is the IP of my DSL connection and a.b.c.d is the IP of the server and domain.com the domain name with the error.

Any help?
 
What about adding to http section of /etc/nginx/nginx.conf:

proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;

Does it help after nginx service restart?
 
Thanks for the reply.

Added that lines and restart nginx without success. I´m going to open a sport ticket.
 
What is ticket ID? I would like to check processing. Thanks.
 
Hello,

This was the error. fail2ban was activated on the server. IP of the server was banned in plesk-modsecurity jail (don´t know why). So the result was 502 error bad gateway... I moved the IP to the white list and the problem was fixed.
 
Back
Top