/ โ† HTTP Error Fixes / Server Error (5xx)
In this guide
  1. What Server error (5xx) actually means
  2. The usual causes and how to tell them apart
  3. How to find the failed requests in your logs
  4. The key changes that stop the errors
  5. Platform notes
  6. A worked example
  7. The fix, step by step
  8. Edge cases worth knowing
  9. Keeping server errors away
  10. Questions and answers

What Server error (5xx) actually means

Every response a web server sends starts with a three-digit status code. Codes from 500 to 599 mean the server accepted the request but failed to complete it. When Googlebot receives one of these for a URL, or the connection times out before any answer arrives, Search Console lists that URL under Server error (5xx) in the Page indexing report.

The important word is when. Search Console records what happened on Google's last crawl of that URL. If your server was overloaded for twenty minutes at 3 am, every URL Google happened to request in that window can be listed, even though they all work now. That is why the first job is never to stare at the page in your browser; it is to find out what the server was doing at the time Google called.

CodeNameWhat it usually means in practice
500Internal Server ErrorThe application crashed: a PHP fatal error, an exception, a broken plugin or a failed database query
502Bad GatewayA proxy (nginx, a CDN, a load balancer) got an invalid answer or no answer from the application behind it
503Service UnavailableThe server is overloaded, in maintenance mode, or a security layer is refusing the request
504Gateway TimeoutA proxy waited too long for the application to respond
520 to 526Cloudflare-specific codesCloudflare could not get a valid response from your origin server; 521 means the origin refused the connection, 522 and 524 are timeouts

Google treats 5xx codes, and also 429 Too Many Requests, as a sign that the server is struggling. Its crawlers respond by slowing down. If the errors continue, URLs that were indexed can be removed, and new URLs wait longer to be crawled at all. A handful of 5xx URLs after a known outage is not a crisis. A steady trickle that keeps growing is.

๐Ÿ’ก The Crawl stats report (Settings, then Crawl stats) shows the share of all Googlebot requests by response code and has a Host status panel for server connectivity. It is the fastest way to see whether errors are a one-off spike or an ongoing pattern.

The usual causes and how to tell them apart

Most 5xx errors seen by Googlebot come from a short list of causes. The pattern in the report, and what the logs say at the time, tells you which one you have.

CauseTypical patternWhere the evidence is
Application errors (PHP fatal, exception)The same URLs or template fail every timeApplication or PHP error log; a 500 when you request the URL with curl
Server capacity (workers, memory, database connections)Many unrelated URLs fail in clusters at busy timesError log lines such as max_children reached or Too many connections
Firewall, WAF or rate limitOnly bots fail; your browser never sees an errorSecurity plugin or WAF event log; 503 or 429 responses to Googlebot user agents
CDN or proxy cannot reach origin502, 504 or 52x codes, often during deploys or origin restartsCDN analytics and logs; nginx proxy error log
Slow pages hitting a timeoutHeavy pages such as large category or search pages fail; light pages passResponse time column in access logs; upstream timed out in proxy logs
Scheduled jobsErrors at the same time every nightCron schedules, backups, imports

If only some URLs fail, look for what they share: a slow template, a heavy query or a plugin that runs only on those pages.

How to find the failed requests in your logs

Start in Search Console. Open the Server error (5xx) reason in the Page indexing report and pick three or four example URLs. Run each through URL Inspection and note the Last crawl date and time. Now you have moments to look for.

Next, check that the URLs work right now from outside your network:

curl -sS -o /dev/null -w "%{http_code} %{time_total}s\n" https://example.com/some-page/
curl -sS -o /dev/null -w "%{http_code} %{time_total}s\n" -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://example.com/some-page/

If the second command returns 403, 429 or 503 while the first returns 200, a security rule is treating the Googlebot user agent differently. If both return 200 quickly, the problem was temporary and the logs will tell you what happened.

Search the access log

List Googlebot requests that ended in a 5xx code, with the time and URL. The log location depends on the host; on Plesk it is usually under /var/www/vhosts/system/example.com/logs/, and on a plain Apache or nginx server under /var/log/apache2/ or /var/log/nginx/.

grep "Googlebot" access_log | awk '$9 ~ /^5/ {print $4, $9, $7}' | sort | uniq -c | sort -rn | head -50

This counts each time, status and path combination, so clusters stand out. The field numbers assume the common combined log format; check one line and adjust if yours differs.

Read the error log for the same minutes

The access log tells you what failed. The error log tells you why. Open the error log and look at the minutes around each failure:

grep -i -E "fatal|max_children|too many connections|upstream timed out|out of memory" error_log | tail -40

Typical lines and what they mean:

Check the request really came from Google

Plenty of scrapers claim to be Googlebot. Before you change any rules, confirm an IP address from the log with a reverse lookup and then a forward lookup:

host 66.249.66.1
# 1.66.249.66.in-addr.arpa domain name pointer crawl-66-249-66-1.googlebot.com.
host crawl-66-249-66-1.googlebot.com
# crawl-66-249-66-1.googlebot.com has address 66.249.66.1

A genuine Googlebot address resolves to a host name ending in googlebot.com, google.com or googleusercontent.com, and that host name resolves back to the same IP. Google also publishes its crawler IP ranges as JSON files, which most firewalls can import.

If you would rather not work through logs by hand, the HTTP error audit and the log analyser show which URLs return errors and how often crawlers hit them.

The key changes that stop the errors

Capacity: workers, memory and database

If errors cluster at busy times, the server is running out of something. The quickest gains usually come from caching, because a cached page costs almost nothing to serve. A full-page cache in front of WordPress or another CMS can take most crawler traffic off PHP and the database entirely. After that, raise the limits that the error log names, within what the server's memory can support:

; PHP-FPM pool, for example /etc/php/8.3/fpm/pool.d/www.conf
pm = dynamic
pm.max_children = 20
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6

# MySQL or MariaDB, my.cnf
[mysqld]
max_connections = 200

Size pm.max_children from memory: at about 80 MB per PHP process and 1.6 GB to spare, 20 is the ceiling. Going higher swaps 503s for a server that grinds to a halt.

Timeouts on proxies and CDNs

A 502 or 504 from nginx in front of PHP-FPM or Node.js often means the proxy gave up first. Raise the proxy timeout only after you have looked at why the page is slow, but make sure it is not shorter than your slowest legitimate page:

location ~ \.php$ {
    fastcgi_read_timeout 60s;
}
location / {
    proxy_connect_timeout 10s;
    proxy_read_timeout 60s;
}

Pages that take tens of seconds to build are a problem in their own right. See fixing 504 errors and fixing slow templates.

Planned downtime: use 503 with Retry-After

During maintenance, return 503 with a Retry-After header, never a 200 page saying the site is down and never a redirect to a holding page. Google treats a short period of 503 as temporary and comes back later.

# nginx: maintenance mode for everyone except your own IP
location / {
    if ($remote_addr != 203.0.113.10) {
        add_header Retry-After 3600 always;
        return 503;
    }
}
โš ๏ธ A 503 that lasts more than a day or two stops being temporary in practice. Google will crawl less and may start dropping URLs. Keep maintenance windows short, and switch maintenance mode off as soon as the work is done.

Platform notes

A worked example

An online shop sees 200 product pages under Server error (5xx). URL Inspection on five of them shows last crawl times between 02:05 and 02:40 on the same morning. Every page loads in under a second now.

Searching the access log for that half hour shows 340 Googlebot requests, 212 of them with status 503. The error log for the same minutes repeats one line: the database has reached its connection limit. The cron table shows a nightly stock import starting at 02:00 that opens a connection per product.

The fix has two parts: the import moves to 04:30, after Google's usual busy period for that site, and is changed to reuse a single connection; max_connections is raised from 100 to 200. The next night the log shows no 503s. The owner chooses Validate fix in Search Console, and over the following fortnight the URLs move out of the error list as Google recrawls them.

The fix, step by step

Step 1

List the affected URLs and crawl times

Open the Page indexing report in Search Console, choose the Server error (5xx) reason and export the example URLs. Run four or five of them through URL Inspection and write down the Last crawl date and time for each. Group the URLs by page type, such as product, category or post. You now have the moments to search for in your logs and a clear picture of whether one template or the whole site is affected.

Step 2

Test the URLs as a browser and as Googlebot

Request each sample URL with curl twice: once with a normal user agent and once with the Googlebot user agent string, printing the status code and total time with the -w option. Compare the results. A 200 for both means the failure was temporary. A 403, 429 or 503 only for the Googlebot request points at a security rule. A 500 for both means the page is broken now and needs fixing first.

Step 3

Find the failed requests in the access log

On the server, search the access log for lines containing Googlebot with a status from 500 to 599, printing the time, status and path. Count the failures per hour to see whether they cluster at particular times. Check the minutes around the Last crawl times from Search Console. If the log shows 200 for those requests, the error happened at a CDN or proxy in front of your server, so check that layer next.

Step 4

Read the error log for the cause

Open the web server, PHP or application error log and read the lines from the same minutes as the failed requests. Look for a fatal error, memory exhaustion, pm.max_children reached, a database connection limit or an upstream timeout. Write down the exact message. That message is the cause you will fix, and it tells you whether the problem is broken code, missing capacity, a slow page or an external service.

Step 5

Verify Googlebot and fix security rules

Take the IP addresses of blocked requests and confirm they are genuine Googlebot with a reverse DNS lookup, then a forward lookup that returns the same IP. If they are real, add an allow rule for verified Googlebot in your security plugin, WAF or rate limiter, rather than an allow rule for the user agent string. Confirm the fix by repeating the Googlebot curl test and watching the security log for new blocks.

Step 6

Fix capacity, code or timeouts

Apply the change that matches the cause you found. Fix the plugin or code behind a fatal error. Add a page cache and raise pm.max_children or max_connections within what memory allows when workers or connections run out. Raise proxy timeouts only after speeding up slow pages. Move scheduled jobs out of busy hours. Then watch the error log for a day to confirm the original message no longer appears.

Step 7

Check the CDN and origin connection

If errors are 502, 504 or a Cloudflare 52x code, open the CDN's analytics or logs for the same times. Confirm the origin was running, that its firewall allows the CDN's addresses, and that its SSL settings match the CDN mode. Make sure the CDN timeout is longer than your slowest legitimate page. Request a few URLs through the CDN and directly to the origin to confirm both return 200.

Step 8

Use 503 with Retry-After for maintenance

Change your maintenance process so planned downtime returns a 503 status with a Retry-After header, never a 200 holding page or a redirect. Keep the window short, ideally under a few hours, and make sure maintenance mode switches off automatically. Test it once on staging with curl to confirm the status and header appear, so that the next planned update does not cause a fresh batch of errors in Search Console.

Step 9

Validate the fix and monitor crawl stats

When the sample URLs return 200 consistently and your logs show no new 5xx responses to Googlebot for several days, open the Server error (5xx) reason in Search Console and choose Validate fix. Validation can take up to about two weeks as Google recrawls the URLs. Meanwhile, check the Crawl stats report weekly and confirm the share of server error responses is falling towards zero.

Edge cases worth knowing

Keeping server errors away

Once the errors stop, keep watching for a few weeks. Check the Crawl stats report weekly: the share of server error responses should stay near zero, and the Host status panel should show no recent problems. A sudden rise usually follows a plugin update, a new scheduled job or a traffic spike.

Running a regular site audit alongside these checks catches new errors before Google reports them.

Questions and answers

1. Why does Search Console show a server error when my page works fine?

Search Console reports what happened when Googlebot last crawled the URL, not what happens when you open it now. If your server was overloaded, restarting or blocking bots at that moment, Google recorded the error even though the page has worked since. Check the Last crawl time in URL Inspection and look at your server logs for that time. You will usually find a cluster of failed requests caused by a busy period, a scheduled job or a security rule rather than a permanently broken page.

2. Will 5xx errors make my pages drop out of Google?

Persistent 5xx errors can remove pages from Google's index, but a short outage normally does not. Google treats server errors as a sign that the site is struggling and slows its crawling to avoid making things worse. If a URL keeps returning errors over a longer period, Google may drop it from the index until it can fetch it again. Fixing the cause quickly and keeping errors near zero protects both your indexed pages and the speed at which new pages are crawled.

3. How do I check whether a request really came from Googlebot?

Run a reverse DNS lookup on the IP address, then a forward lookup on the host name it returns. A genuine Googlebot address resolves to a host name ending in googlebot.com, google.com or googleusercontent.com, and that host name resolves back to the same IP address. Anyone can fake the Googlebot user agent string, so never trust it on its own. Google also publishes its crawler IP ranges, which many firewalls and security plugins can use to allow verified crawlers.

4. What is the right status code for planned maintenance?

Return 503 Service Unavailable with a Retry-After header for planned maintenance. This tells Google the outage is temporary and when to come back, so it does not treat your pages as gone or replace them with a holding message. Do not serve a 200 page that says the site is down, because Google may index that text, and do not redirect every URL to a single maintenance page. Keep the window short, because a 503 lasting days starts to reduce crawling.

5. Can a security plugin or firewall cause 5xx errors for Google?

Yes, security plugins, web application firewalls and rate limits are a common cause of 5xx errors that only Googlebot sees. Some answer suspected bots with 503 or 429, and some send a challenge page that crawlers cannot pass. Check the security log for blocked requests at the times Google crawled, verify the addresses are genuine Googlebot, and add an allow rule for verified Google crawlers. Avoid allowing the user agent string alone, because scrapers routinely fake it.

6. How long does Validate fix take for server errors?

Validation for server errors usually takes up to about two weeks, and sometimes longer on large sites. Google recrawls a sample of the affected URLs, and if they return 200 the validation moves on and the URLs leave the error list. If any URL still fails, validation can fail and you will need to fix the remaining cause and start again. Only choose Validate fix once your own logs show no new 5xx responses to Googlebot for several days.

7. What is the difference between a 502, a 503 and a 504?

A 502 means a proxy received a bad or empty response from the server behind it, a 503 means the server is overloaded, in maintenance or refusing the request, and a 504 means the proxy waited too long for an answer. In practice, 502 often points at a crashed or restarting application, 503 at capacity limits or security rules, and 504 at slow pages or short timeouts. All three count as server errors in Search Console, and the error log tells you which applies.

Find the URLs returning server errors

The HTTP error audit checks your pages for 5xx responses and timeouts and lists which URLs fail, so you can fix the cause before Google reports it in Search Console.

Open HTTP Error Fixes โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: All HTTP Error Fixes  ·  How to fix 500 errors  ·  How to fix 502 errors  ·  How to fix timeout errors  ·  Search Console errors explained  ·  Learning Hub

About aiwebpageseo

aiwebpageseo.com is a data-driven SEO and AEO (Answer Engine Optimisation) platform providing a free suite of technical SEO tools. Rather than relying on AI-theorised assumptions, the platform analyses live URL performance, delivering objective diagnostics, page speed metrics, CLS debugging, and site crawl data alongside actionable technical tutorials.