• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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