Free auditStart free
GuideError · HTTP status codes

503 Service Unavailable in Apache

Diagnose an Apache 503 from the error log: backend marked down by mod_proxy, MaxRequestWorkers, or maintenance mode. Includes configs and a Retry-After setup.

4 min
read
9
sources
Oct 29, 2026
updated
Scaplet Editorial Team
author
The short answer

An Apache 503 Service Unavailable usually comes from mod_proxy, not from Apache running out of workers. When a proxied backend is in an error state or all balancer members are busy, mod_proxy returns 503; maintenance rewrites return it on purpose. Read the error log for disabled connection or all workers are busy, fix the backend, then send Retry-After during planned downtime.

  1. Start with the error log line, not the config
  2. Fix by cause
  3. Test the maintenance response and the crawler effect
30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
02Fix it on your stack

Fix by cause

mod_proxy: shorten the error-state wait
# retry: seconds before Apache sends requests to a worker in error state again
# default is 60; 0 means always retry
ProxyPass "/app" "http://127.0.0.1:8080/app" retry=5
ProxyPassReverse "/app" "http://127.0.0.1:8080/app"
Event MPM: the documented defaults, spelled out
# Defaults for threaded MPMs: ServerLimit 16 x ThreadsPerChild 25 = 400 threads.
# To go past 16 processes you must raise ServerLimit as well.
# Example values only; size them to your RAM, not to this snippet.
<IfModule mpm_event_module>
    ServerLimit          32
    ThreadsPerChild      25
    MaxRequestWorkers    800
</IfModule>
Planned maintenance that answers 503 with Retry-After
# Needs mod_rewrite and mod_headers
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/maintenance.html
RewriteRule ^ - [R=503,L]

ErrorDocument 503 /maintenance.html

# "always" adds the header to error responses and keeps it
# across internal redirects such as ErrorDocument handlers
Header always set Retry-After "3600"

In that rule R=503 is outside the 300-399 range, so Apache drops the substitution and stops rewriting, as if L were set. The RewriteCond exempts the maintenance page itself so the ErrorDocument can be served. Remove the block to end maintenance.

03How it works

Test the maintenance response and the crawler effect

Use a 503 maintenance rule when
  • Downtime is planned and short, hours or a day or two
  • You can send `Retry-After` so crawlers and clients know when to return
  • The whole site is affected, not one URL
Do something else when
  • A single page is gone for good: use a 410 or a 301, not a long 503
  • The backend is just slow: look at [504 Gateway Timeout](/errors/http/504)
  • The outage may last many days: Google may drop URLs that keep returning 503
  1. 01

    Check status and header

    Run curl -sSI https://example.com/some-page and confirm HTTP/1.1 503 and a Retry-After value.

  2. 02

    Check the page still renders

    Open the URL in a browser. You should see maintenance.html, not Apache's default error text.

  3. 03

    Time-box it

    Google's crawl-rate guide says 503 or 429 with a Retry-After (seconds or an HTTP date) is the way to slow its crawlers for "a couple of hours, or 1-2 days". It warns against doing this longer, and says that if Googlebot sees these codes on the same URL for multiple days, "the URL may be dropped from Google's index".

  4. 04

    Remove the rule and re-request

    After the rewrite block is gone, request the page again and confirm a 200. Google increases the crawl rate again once the error count falls.

Sources · 9

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • apache.org
  • github.com
  • mozilla.org
  • google.com
  1. 01Apache httpd 2.4: MPM common directives (MaxRequestWorkers)httpd.apache.org · checked 2026-11-01
  2. 02Apache httpd 2.4: mod_proxy (retry, ProxyPass parameters)httpd.apache.org · checked 2026-11-01
  3. 03Apache httpd 2.4 source: modules/proxy/proxy_util.cgithub.com · checked 2026-11-01
  4. 04Apache httpd 2.4 source: server/mpm/event/event.cgithub.com · checked 2026-11-01
  5. 05Apache httpd 2.4: RewriteRule flagshttpd.apache.org · checked 2026-11-01
  6. 06Apache httpd 2.4: mod_headershttpd.apache.org · checked 2026-11-01
  7. 07Apache httpd 2.4: core features (ErrorDocument)httpd.apache.org · checked 2026-11-01
  8. 08MDN: 503 Service Unavailabledeveloper.mozilla.org · checked 2026-11-01
  9. 09Google: Reduce the Googlebot crawl ratedevelopers.google.com · checked 2026-11-01
Questions

Asked a lot.

4 questions people ask next, answered from the sources on this page.

01Why does Apache return 503 when the backend restarts?

mod_proxy marks a failed worker as being in an error state and sends it no requests until its retry timeout expires, which defaults to 60 seconds. Set a smaller retry on the ProxyPass, or retest after the timeout.

02Does hitting MaxRequestWorkers cause a 503?

Not by itself. The Apache docs say connections over the limit are normally queued, up to the ListenBacklog value, until a worker frees up. You get slow responses and the AH00484 message first. A 503 in front of a backend is more often mod_proxy.

03What is the correct way to show a maintenance page in Apache?

Return 503 with a Retry-After header and serve a local HTML page through ErrorDocument 503, as in the config above. Avoid answering a maintenance window with a 200, because the status then tells crawlers the page is healthy.

04How long can a site return 503 before it hurts search?

Google says not to use 503 for longer than 1-2 days, and that URLs seen with these codes for multiple days may be dropped from the index.

Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane