Apache AH01114 / AH00957: failed to make connection to backend
Apache AH01114 failed to make connection to backend (AH00957): the proxy could not connect and returned 503. Read the errno, then fix the address and port.
[proxy:error] [pid …] (111)Connection refused: AH00957: http: attempt to connect to 127.0.0.1:8080 (127.0.0.1:8080) failed[proxy_http:error] [pid …] [client 203.0.113.5] AH01114: HTTP: failed to make connection to backend: 127.0.0.1Apache AH01114: failed to make connection to backend means it could not open a TCP connection to the backend named in ProxyPass; make sure the backend is running and that ProxyPass uses the address and port it listens on. The client gets a 503. The text in brackets before AH00957 tells you why. (111)Connection refused means nothing is listening on that address and port, so start by checking whether the backend is running and which address it listens on.
[1] Read the text in brackets. The number is the operating system's error code.
| In brackets | Meaning | Check first |
|---|---|---|
(111)Connection refused | No process listening on that address and port | Backend is down or listens elsewhere → [2], [3] |
(110)Connection timed out | No answer before the timeout | Firewall or routing, when the backend is on another host |
(13)Permission denied | The OS blocked the connection itself | SELinux on RHEL-family systems (note below) |
Only (111) was reproduced. The other two rows give the general meaning of those error codes; they were not produced here.
[2] Check whether the backend is listening, and on which address. Run these on the Apache host.
# ss -ltnp | grep ':8080'# curl -sv http://127.0.0.1:8080/ -o /dev/nullNo line from ss means the backend is not running. In the reproduction, starting the backend made the very next request return 200. If there is a line but the address is [::1]:8080 or a container address instead of 127.0.0.1:8080, point ProxyPass at that address.
[3] If ProxyPass uses localhost, check which address it actually connects to. localhost usually resolves to both IPv6 (::1) and IPv4 (127.0.0.1).
# grep localhost /etc/hosts127.0.0.1 localhost::1 localhost ip6-localhost ip6-loopbackHere the backend listened on 127.0.0.1 only, the front used ProxyPass "/app/" "http://localhost:8080/", and logging was set to LogLevel warn proxy:debug:
$ curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8081/app/200$ grep -E "AH00957|AH01114|AH00959" /usr/local/apache2/logs/error_log[Tue Oct 27 04:03:37.261657 2026] [proxy:debug] [pid …] proxy_util.c(3949): (111)Connection refused: AH00957: http: attempt to connect to [::1]:8080 (localhost:8080) failedThe request succeeded, but Apache first tried ::1, was refused, and then moved on to 127.0.0.1. When a name resolves to several addresses, the httpd source logs only the last address's failure at error level and the earlier ones at debug, so the ::1 attempt is invisible at the default log level. Writing the backend's actual address (127.0.0.1) in ProxyPass removes that wasted attempt.
[4] Check whether 503s continue after the backend is back. The ProxyPass retry parameter (default 60 seconds) keeps requests away from a worker in the error state for that long. On httpd 2.4.69 the result depended on the setup:
| Setup | Log after the failure | Request right after the backend starts |
|---|---|---|
Plain ProxyPass "/app/" "http://127.0.0.1:8080/" | AH00957 · AH01114 | 200 |
balancer:// with one member | AH00957 · AH00959 … disabling worker for (127.0.0.1:8080) for 60s · AH01114 | 200 |
The plain worker never entered the error state; the httpd source marks workers outside a balancer to ignore errors. The one-member balancer logged a 60-second disable with AH00959 but recovered at once, because forcerecovery (default On in the mod_proxy docs) immediately recovers all workers when every worker of a balancer is in error. Per the docs, a worker is skipped for the retry period when a balancer has several members and the others are still up (several members were not tested here). To shorten that period, give the member a retry.
[Tue Oct 27 04:36:41.861460 2026] [proxy_balancer:emerg] [pid …] AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded??[Tue Oct 27 04:36:41.861534 2026] [:emerg] [pid …] AH00020: Configuration Failed, exitingMake the change in this order.
1. Copy the configuration file.
# cp -a /usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/httpd.conf.bak2. Check that the LoadModule lines for all three are enabled (the default httpd.conf in the official image has them commented out). -t does not catch this, so list the modules actually loaded with -M. Here only mod_slotmem_shm was left disabled:
# httpd -M 2>/dev/null | grep -E "proxy_balancer|slotmem|lbmethod" proxy_balancer_module (shared) lbmethod_byrequests_module (shared)slotmem_shm_module is missing, so uncomment LoadModule slotmem_shm_module modules/mod_slotmem_shm.so in httpd.conf. With the Ubuntu package, enable them with a2enmod proxy_balancer slotmem_shm lbmethod_byrequests (that command was not tested here).
3. Change ProxyPass to the balancer.
<Proxy "balancer://app"> BalancerMember "http://127.0.0.1:8080" retry=5</Proxy>ProxyPass "/app/" "balancer://app/"4. Send apachectl -k graceful only when both apachectl -t and the -M check in step 2 are right. If Apache does not come up or 503s and 500s rise, restore the copy and start it again:
# cp -a /usr/local/apache2/conf/httpd.conf.bak /usr/local/apache2/conf/httpd.conf# apachectl -t && apachectl -k gracefulWith all three modules loaded, the log for this setting changed to disabling worker for (127.0.0.1:8080) for 5s. Per the docs, retry=0 means always retry a worker in the error state without waiting. That keeps sending requests to a dead backend, so with several members pick a short positive value instead of 0.
[5] After the fix, request the front address again and confirm a 200 and no new AH00957 lines. With the Ubuntu package the log is /var/log/apache2/error.log. The nginx version of this situation is reading nginx 502 Bad Gateway logs, and HAProxy's is HAProxy 503 no server available.
Analyze your Apache log in the browser ↗ — nothing is uploaded.
Check it with the HTTP status codes tool ↗ — calculated in your browser.