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

Issue All domains return 504 Gateway Timeout

Kaspar

API expert
Plesk Guru
Server operating system version
AlmaLinux 8.6
Plesk version and microupdate number
18.0.43
I can't wrap my head around the following issue. Somehow all domains on a particular server respond with a 504 Gateway Timeout. In the error logs of a there is the 67850#0: *18 upstream timed out (110: Connection timed out) while connecting to upstream error as you would expect, but there are no other errors.

# service nginx status indicates not errors or issues, Nginx is running. Also nginx -t does not report any issues. Disabling the Smart static files processing option on a domain basis (Example.com > Apache & nginx Settings ) does not solve anything either.

Only when I fully disable Nginx (/usr/local/psa/admin/sbin/nginxmng --disable) all website become accessible again.

Anyone any clues on where to go next with this issue?
 
Last edited:
Are the PHP-FPM services running? Are the domains configured with the correct PHP interface (e.g. via Apache when you are using Apache, via Nginx when you are solely using Nginx)?
 
Are the PHP-FPM services running? Are the domains configured with the correct PHP interface (e.g. via Apache when you are using Apache, via Nginx when you are solely using Nginx)?
Nginx is only used as Proxy. PHP-FPM services run as Apache, but switching it to run as Nginx does not solve it unfortunately.

The strange thing is that this issue even affects domains that only serve static html pages, on which PHP is disabled. This really puzzles me. Looks like Nginx cannot communicate with Apache at all (or the other way around).

Plesk repair web does not solve anything either, nor does it report any errors.

I might reinstall Nginx to see what that does.
 
What about 127.0.0.1?
No, 127.0.0.1 isn't listed either. The issue appears to be bigger then I thought. Mail log is full with
Code:
NOQUEUE: milter-reject: CONNECT from mail-vs1-f45.google.com[209.85.217.45]: 451 4.7.1 Service unavailable - try again later; proto=SMTP
 
Okay, adding the server IP server to the a rule in the Plesk Firewall solves the issues. Strangely enough, removing the rule with the server IP from the firewall does not bring back the issue. Very strange.

Still a mystery why this happend.
 
Last edited:
Hello Kaspar,

I believe that happens because your upstream takes too much to reply to the request and NGINX thinks the upstream already failed in processing the request, so it responds with an error. Just include and increase proxy_read_timeout in the location config block.
According to me, There are two main directives responsible for Nginx upstream timed out (110: Connection timed out) error:
It Defines as a timeout for reading a response from the proxied server. Default is 60 seconds.

.....

location ~ ^/slow-proxy {

proxy_read_timeout 180; # <---

proxy_pass ...;
}

.....


* you can use proxy_read_timeout inside http, server, and location blocks.


And second is fastcgi_read_timeout – Which defines as a timeout for reading a response from the FastCGI server. Default is 60 seconds.

.....

location ~ \.php$ {

fastcgi_read_timeout 180; # <---

fastcgi_pass ...;
}

.....

* you can use fastcgi_read_timeout inside http, server, and location blocks.
 
Back
Top