Websites are inaccessible with 504 Gateway Timeout with enabled firewall: 110: Connection timed out

Created:

2016-11-16 13:13:42 UTC

Modified:

2017-02-28 07:53:25 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Websites are inaccessible with 504 Gateway Timeout with enabled firewall: 110: Connection timed out

Symptoms

If Nginx is enabled, all sites return 504 Gateway Timeout error.

Firewall is strictly configured on the server.
In /var/log/httpd/error_log :

upstream timed out (110: Connection timed out) while reading response header from upstream

Cause

Firewall blocks connection on port 7080 and 7081, so Nginx is unable to connect to Apache.

Resolution

Add firewall rules, for example:

-A INPUT -s 10.10.10.10 -p tcp -m tcp --dport 7081 -j ACCEPT  
-A INPUT -s 10.10.10.10 -p tcp -m tcp --dport 7080 -j ACCEPT
-A INPUT -s 10.10.10.11 -p tcp -m tcp --dport 7081 -j ACCEPT
-A INPUT -s 10.10.10.11 -p tcp -m tcp --dport 7080 -j ACCEPT
-A OUTPUT -s 10.10.10.10 -p tcp -m tcp --sport 7081 -j ACCEPT
-A OUTPUT -s 10.10.10.10 -p tcp -m tcp --sport 7080 -j ACCEPT
-A OUTPUT -s 10.10.10.11 -p tcp -m tcp --sport 7081 -j ACCEPT
-A OUTPUT -s 10.10.10.11 -p tcp -m tcp --sport 7080 -j ACCEPT
Have more questions? Submit a request
Please sign in to leave a comment.