Skip to content

Instantly share code, notes, and snippets.

@ifnull
Created June 3, 2014 22:11
Show Gist options
  • Select an option

  • Save ifnull/9f3ef06bd05083e1872f to your computer and use it in GitHub Desktop.

Select an option

Save ifnull/9f3ef06bd05083e1872f to your computer and use it in GitHub Desktop.
Solving Apache 503 “Service temporarily unavailable” error in Gunicorn/Apache on CentOS

Error

[Tue Jun 03 22:05:51 2014] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed
[Tue Jun 03 22:05:51 2014] [error] ap_proxy_connect_backend disabling worker for (127.0.0.1)
[Tue Jun 03 22:05:52 2014] [error] proxy: HTTP: disabled connection for (127.0.0.1)
[...]

The problem is that the Apache proxy module, recognising that the service was unavailable, stopped redirecting requests to it for one minute.

The problem was solved adding a retry=0 parameter to the ProxyPass directive.

Solution

Adjust the following lines in your vhost then restart Apache

ProxyPass / http://127.0.0.1:8001/ retry=0 timeout=5
ProxyPassReverse / http://127.0.0.1:8001/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment