• 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.

Resolved 502 Bad Gateway on All domains

I had been encountering the issue for a week (I guess). Every morning I was waking up to 502 bad gateway for all domains and their subdomains. I was disabling and and then enabling the domains/subdomains for them to work again.

I am using Plesk Onyx as a trial on two identical servers (for testing purposes). Both have Plesk Firewall, mod_security (with comodo rules) and fail2ban enabled + one has mod_evasive enabled.

the suggestions in the https://talk.plesk.com/threads/502-bad-gateway-on-all-domains.339677/page-3#post-812512 resolved the issue for me. (I also added servers' own IPs to whitelist of fail2ban, additionally. Not sure if this is also a configuration for the issue to be solved.

thanks.

Are you using Ubuntu?
 
Today i had the same issue: apache crash on reload. solved the issue by disabling apache mod fastcgi. There were mod_fcgid and mod_fastcgi installed. I Think this happened because i installed plesk on a non-clean ubuntu installation where apache2 and mod_fastcgi was already installed.
 
I have the same Problems with same results .

file_get_contents (internal.domain) ANY INTERNAL DOMAIN ON SERVER NOT WORKING 502 oder 404 or White unkown Site coming likte this
BUT
file_get_contents (Google) working great any extrenal domain

And the same results is in WGET Command on Terminal
wget internal.domain) ANY INTERNAL DOMAIN ON SERVER NOT WORKING 502 oder 404 or empty white page
BUT
wget google.de looks great

The Problems begin after last update it ist not an configuration problem

So note that Response by wget by terminal or file_get_contents by php are not listed in die APACHE Protkoll. So the Commands are not working. Something goeings wrang.

Also i have reinstall fail2ban and switch firewall of an whitelist my ip an 127.0.0.1

but nothing works. It is not an firewall problem it s not working after the last plesk updates

i can youse anyone soft or command s with same results. all extrenal domains works great. but all internal domains cant load form same server. there ist anything 2ban this. or there any dns problems.

I have test this Changes but not working!
  1. Pls. change your apache version from "mpm_event" to "mpm_prefork". ( Home > Tools & Settings > Apache Web Server )
  2. Pls. set the "Apache restart interval" to a higher value, than the standard "0" seconds. ( Home > Tools & Settings > Apache Web Server )
  3. Pls. change EVERY "apache2 reload" - setting to a "apache2 restart" - setting at your depending logrotation definitions under "/etc/logrotate.d/".
    Code:
 
Last edited:
I have not changed anything on the server nor on the configuration, nor on my scripts. The only thing that happened was plesk updates and I just suspect a BUG. After I have a lot of instructions out there to solve the problem. I noticed that the server does not access all internal domains. These accesses are not even logged in the Appache protocol. It affects all internal domains completely. All domains on external servers, however, work great. I uninstalled Fail2ban. Firwall I turned off for testing. The problem remained. At the DNS I can not represent anything wrong. From my home PC, everything is wonderfully accessible. But it does not work from the server. Whether with PHP terminal or any program. All the same result. I then looked iptable -L. My IP is not listed. And my serverIP is on the whitelist. Ich habe wirklich keine ahnung mehr was falsch läuft. Und auch keine Idee mehr woran es liegen könnte. Ausser eben der hoffnung dass jemand noch eine idee hat.
 
So now im fix this Problem. Ist was an ipv6 problem. After 301 response the ipv4 call goes 2 ipv6 an then all calls going 2 default root. so im edit
/etc/gai.conf

uncomment only this line
# For sites which prefer IPv4 connections change the last line to
#
#precedence ::ffff:0:0/96 100

to
# For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96 100

an after that reboot this server
 
Back
Top