Reputation: 31
I have Apache Reverse proxy server which proxies request to my internal Apache server. I am using Apache version 2.4 on Linux platform.
I encountered timeout page and HTTP ERROR 504 whenever back-end Apache server is taking more than 60 seconds ( PHP page waiting for results from Mysql query on back-end Apache server)
Apache Default timeout is set to 300 seconds.
This issue comes only when accessing website through apache reverse proxy. It works well by using internal IP.
I have tried to set below parameters to proxypass but no luck.
ProxyPass / http://internal-ip:8080/ retry=1 acquire=3000 timeout=600 Keepalive=On
I have also tried to ProxyPass on non existing IP which is also showing 504 HTTP ERROR after 60 seconds
Please help me to understand this issue.
<VirtualHost *:80>
ServerName mywebsite.example.com
ServerAlias www.mywebsite.example.com
ProxyPreserveHost On
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/mywebsite.example.com-error.log
CustomLog ${APACHE_LOG_DIR}/mywebsite.example.com-access.log combined
RewriteCond %{REQUEST_METHOD} !^(GET|POST)$
RewriteRule .* - [R=405,L]
ProxyPass /.static-pages !
ProxyPass / http://<Internal Apache Server IP>/
ProxyPassReverse / http://<Internal Apache Server IP>/
</VirtualHost>
Upvotes: 3
Views: 19020
Reputation: 19
I had exact same problem and solved this way:
ProxyRequests off
Timeout 600
ProxyTimeout 600
<Proxy balancer://Mycluster>
BalancerMember http://url:80
ProxySet lbmethod=byrequests timeout=600
</Proxy>
ProxyPass / balancer://Mycluster/ timeout=600
Upvotes: 1