• 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

Resolved All websites are giving a 504 Timeout when Nginx Proxy is enabled

W-Bench

New Pleskian
Problem Starts:
- The problem started when I normally restarted my server. No changes (by me) were done before that. Server was running for more than a year.

Problems:
- When (standard) Nginx Proxy Mode is enabled, ALL websites hosted in Plesk are giving a 504 Timeout Error
Log: Nginx Error: 41273#0: *2173 upstream timed out (110: Connection timed out) while connecting to upstream
- Roundcube is also giving the same error
- E-mail (SMTP and POP/IMAP) is also not working. Can't deliver the message. Connecting (sync) to the server works.
- Tools & Settings -> Updates, Is also giving a Time-Out error only not 504

Following Fixes won't fix the problem:
- Plesk repair all -y is saying that there are no errors (I did run this multiple times)
- Changed the Nginx settings with: proxy_connect_timeout 180s; proxy_send_timeout 180s; proxy_read_timeout 180s; fastcgi_send_timeout 180s; fastcgi_read_timeout 180s, this results in a 502 Bad Gateway error
- Reinstalled Apache

Server:
- Plesk is saying that all services (including Apache) are running normally
- Base OS: AlmaLinux 8.5 (Arctic Sphynx)
- Plesk version: Version 18.0.41 Update #1
- Plesk is on Auto-Update
- Server is running in a Cloud VPS
- My Linux knowledge: Not the best to be honest :)


Please, can someone help me?
I can provide the debug file generated by Plesk.

I also tried to submit a Ticket to Plesk, but getting the following message: "We identified that the Plesk license was purchased not directly from Plesk, but through one of the Plesk Resellers. Please contact your license provider for support service."
My own provider is not giving any support on Plesk error's.

Many Thanks in advance!
 
Did you check if the server IP-address is perhaps blocked by fail2ban?
Could be the cause of the issues you're having.
 
Did you check if the server IP-address is perhaps blocked by fail2ban?
Could be the cause of the issues you're having.
Thanks for your answer!
Unfortunately this is not the case. The IP is not on the list.
I also added the server IP to the fail2ban whitelist.
 
- Plesk is saying that all services (including Apache) are running normally
Don't trust this. Check whether Apache and Nginx are both up with
# service httpd status
(or # service apache2 status, depending on your OS)
# service nginx status
Also make sure that in addition to the server's own public IPv4 address the 127.0.0.1 is also whitelisted in Fail2Ban.

"while connecting to upstream" means: Apache does not deliver an answer. Nginx is up (else it would not log the error at all), but Apache may not be up or as @maartenv correctly said the server's own IP is being blocked, which is the most common cause of the symptom.

If your sites are using PHP-FPM, make sure that the PHP-FPM services are also running, because else Apache might be waiting on a PHP result that never comes in, e.g.
# service plesk-php56-fpm status
...
# service plesk-php70-fpm status
# service plesk-php71-fpm status
# service plesk-php72-fpm status
...
# service plesk-php80-fpm status
 
O.k., it's CentOS 8. That's why I didn't see the command. CentOS 8 was end of life last year. You need to migrate to Rocky Linux or Alma Linux to continue with this constellation and Plesk.

Also: httpd is still the same service name in CentOS 8 as it was in earlier RHEL operating system derivates. So if httpd is not known, may it has been removed? That could also explain why Nginx does not get a response from it any more.

# systemctl status httpd

should definitely give you the httpd status (all CentOS versions). Also check your Linux process list for "httpd" or "apache", e.g
# ps aux | grep httpd
# ps aux | grep apache
to see whether the web server shows up there anywhere.
 
Strange that it says CentOS8. I switched to AlmaLinux months ago.

Service Status 2.png

Thanks for your patience. As I said, my Linux knowledge is not the best.
 
"service -t" ???? Never seen that. What does it do?
Weirdly the service command on the Plesk SSH terminal extensions differs from the usual service command of the OS. Probably a Plesk variant as it also displays the Plesk version (18.0.41) and the Wrong OS (CentOS 8 instead of AlmaLinux 8).
 
I also tried to submit a Ticket to Plesk, but getting the following message: "We identified that the Plesk license was purchased not directly from Plesk, but through one of the Plesk Resellers. Please contact your license provider for support service."
My own provider is not giving any support on Plesk error's.
Support is not included in your licence because you obtained it trough a reseller (or was included with your VPS). But you can still purchase support from Plesk if you wish. First month is free. See: https://support.plesk.com/hc/en-us/articles/213953025-How-to-get-support-directly-from-Plesk-
 
No changes (by me) were done before that. Server was running for more than a year.
You migrated to Almalinux a year ago? What was the reason for the reboot now?

I still think it is either a firewall block or the PHP-FPM services that are not running for some reason.
 
Yes, follow @Rasp advice. It seems that the migration to AlmaLinux was no completed correctly. That may be the reason for the update error and it may also be the reason for the service issues.
 
Everyone, Thanks for the support!
I just submitted a Ticket. I will return with the Tickets results when they come available.
 
Plesk Support just closed my ticket.
The problem was that "firewalld" was enabled and randomly was blocking access to Apache and my mail.

Plesk suggested disabling "firewalld" and this fixed all the server issues.

Everyone, thanks for the support!

@moderators: You can close this topic.
 
Back
Top