Error 504 Gateway timeout

504gatewayload balancingtimeout

I would like to know if an error 504 Gateway timeout always come from the load balancer or it can also be originated from Apache and the PHP code it's running ?

Thanks

Best Answer

It usually happens when the load balancer is waiting for a response from apache and apache is not giving a response within the timeout period of load balancer. So it returns a 504 gateway timeout. About what causes apache to not respond is something only you can say as you have not given much background information on what apache is serving. Look at apache logs to know more details . usually access logs and error logs. Increase the timeout value of loadbalancer, to see if it helps. It is always good to have clustering on apache so you dont get 504 because of a dead apache instance. I think mod_proxy allows you to achieve software clustering. I am not sure check out on apache site.