How to Fix Server Errors (5xx) Found in Your Site Audit
Your crawl found pages that answered with a 5xx status code (500, 502, 503, 504) or returned no response at all because the connection timed out, was reset or failed during the TLS handshake. In this guide you will reproduce each failing URL, find the cause in your server logs, fix the broken routes or capacity limits, and confirm that every page returns a clean response. The check fails when 1% or more of crawled pages error out, so even a few bad templates can trigger it.

Why it matters
A 5xx tells Googlebot and AI crawlers that the page is unavailable. Occasional errors slow crawling, because Google reduces its crawl rate when a host keeps failing. Errors that persist for days can get URLs dropped from the index and from AI answer sources.
Visitors who hit a 502 or a blank timeout usually leave and do not come back, and checkout or form errors cost you revenue directly. A rising error rate is also a common early sign of resource exhaustion, a bad deploy or bot abuse.
What you need
Step-by-step fix
Reproduce each failing URL
Export the failing URLs from the audit and request each one yourself. Note the exact status code and how long the response takes. A status of 0 in the audit means no HTTP response came back, which is usually a timeout, a dropped connection, a firewall block or a TLS/DNS failure.
Run the test several times. An error that comes and goes points to load or upstream problems, while an error on every request points to a code bug.
# Status code and total time for one URL
curl -s -o /dev/null -w "%{http_code} %{time_total}s\n" --max-time 30 https://example.com/products/blue-mug
# Check a whole list (urls.txt = one URL per line)
while read u; do curl -s -o /dev/null -w "%{http_code} %{time_total}s $u\n" --max-time 30 "$u"; done < urls.txtMatch the errors in your server logs
Look up the same URLs and timestamps in your access log and error log. The access log confirms which status was sent. The error log, PHP-FPM log or application log shows why.
Search for upstream timeouts, fatal errors, out-of-memory kills and 'too many connections' messages.
# All 5xx responses in the Nginx access log, most frequent URLs first
awk '$9 ~ /^5/ {print $9, $7}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -20
# Recent errors
tail -n 200 /var/log/nginx/error.log
grep -iE "fatal|out of memory|max_children" /var/log/php*-fpm.log
# Process killed by the kernel?
dmesg -T | grep -i "killed process"Classify each error by its status code
Each status code points to a different layer, so group the failures before you fix anything:
- 500: the application crashed. Look for a code bug, a missing record, a bad plugin or a PHP fatal error.
- 502: the proxy got no valid answer from the app. The app process is down, crashed or restarting.
- 503: the server is overloaded or in maintenance mode, or worker pools are full.
- 504 or status 0: the request took too long, or the connection was dropped by a firewall, load balancer or failing TLS.
Fix crashing routes in the application
Read the stack trace for each 500 and fix the root cause. A common one is a page that assumes a product, post or user exists and crashes when it has been deleted. That case should return a 404 (or a 301 to a replacement), not a 500.
Also check for PHP or Node version incompatibilities after upgrades, expired API keys and third-party APIs called without a timeout during rendering.
// Next.js App Router: return 404 instead of crashing on missing data
import { notFound } from 'next/navigation';
export default async function Page({ params }) {
const { slug } = await params;
const product = await getProduct(slug).catch(() => null);
if (!product) notFound();
return <ProductView product={product} />;
}Remove load and timeout bottlenecks
If errors appear under traffic or during crawls, the server is running out of workers, memory or database connections. Raise worker limits to match the RAM you have. Add full-page caching for anonymous visitors.
Fix slow database queries (enable the slow query log). Set proxy timeouts so they are long enough for legitimate pages but still fail fast.
# /etc/php/8.3/fpm/pool.d/www.conf (size to RAM: ~available MB / avg MB per process) pm = dynamic pm.max_children = 40 pm.start_servers = 8 pm.min_spare_servers = 4 pm.max_spare_servers = 12 pm.max_requests = 500 # Nginx server block proxy_connect_timeout 10s; proxy_read_timeout 60s; fastcgi_read_timeout 60s;
Return a proper 503 during planned maintenance
Deploys and maintenance windows often cause 502s or connection resets. Serve a 503 Service Unavailable with a Retry-After header instead. Search engines treat a short 503 as temporary and come back later.
Keep maintenance windows short, because a 503 that lasts several days is treated like a permanent error.
# Nginx: enable by creating /var/www/maintenance.flag
if (-f /var/www/maintenance.flag) { return 503; }
error_page 503 @maintenance;
location @maintenance {
add_header Retry-After 3600 always;
root /var/www/static;
rewrite ^ /maintenance.html break;
}Re-crawl and set up monitoring
Re-test the failing URLs with the curl loop from step 1. Then run a fresh audit and confirm errors are well below 1% of crawled pages, ideally zero. Add uptime monitoring on key templates (home, category, product, article) and watch for new spikes over the next week.
Platform-specific notes
WordPress
Turn on logging in wp-config.php with define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); then read wp-content/debug.log. If a plugin causes the 500, rename its folder in wp-content/plugins via SFTP to disable it. Full-page caching (a caching plugin or host-level cache) and a larger PHP memory_limit fix most load-related 503s and 504s.
Shopify
You cannot change Shopify's servers. Real 5xx responses are rare and usually short platform incidents (check shopifystatus.com). Persistent errors typically come from app proxy routes (/apps/...) or headless storefronts. Contact the app developer, or fix your Hydrogen/Oxygen code and check its logs.
Next.js / Vercel
Open the project's Logs tab in the Vercel dashboard and filter by status 5xx. FUNCTION_INVOCATION_TIMEOUT means a serverless function ran past its maxDuration. Fix it by caching data, using ISR (export const revalidate) or raising maxDuration in the route config. Use notFound() for missing records so they return 404 instead of 500.
Cloudflare
Cloudflare-specific codes point to the origin: 521 means the origin refused the connection, 522 means the connection timed out, 524 means the origin took longer than 100 seconds on non-Enterprise plans, and 525/526 mean SSL handshake or certificate problems. Make sure your origin firewall allows Cloudflare IP ranges, and check that the SSL/TLS mode (Full (strict)) matches a valid origin certificate.
Nginx + PHP-FPM / Node
'upstream timed out' in error.log means a 504, so tune proxy_read_timeout or fix the slow page. 'connect() failed (111: Connection refused)' means a 502 because the app is down; run it under systemd or pm2 with automatic restart. 'server reached pm.max_children' means you need more FPM workers or caching.
Check that it worked
✅ How to verify
- Run curl -s -o /dev/null -w "%{http_code}" on every previously failing URL several times and get 200, 301 or 404, never 5xx or a timeout.
- Re-run the site audit and confirm the server error check passes, with errors under 1% of crawled pages and ideally none.
- Search your access log for 5xx over the past 24 hours: awk '$9 ~ /^5/' /var/log/nginx/access.log | wc -l should be at or near zero.
- In Google Search Console, check that Crawl stats → By response shows the server error share falling, and use URL Inspection → Test live URL on key pages.
⚠️ Common mistakes
- Hiding errors by returning 200 with an error message on the page. This creates soft-404/soft-error pages that rank poorly and hide the real problem.
- Upgrading the hosting plan without reading the logs, when the real cause is one slow query, a crashing plugin or a bot hammering search URLs.
- Returning 500 for deleted products or posts instead of 404/410 or a 301 to a relevant replacement.
- Leaving a site in maintenance mode or a WAF challenge active for days, so crawlers keep getting 503s or dropped connections.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
Do 5xx errors hurt my Google rankings?
Brief, occasional errors usually do not. Google retries and may only slow its crawl rate. If a URL keeps returning 5xx for several days, Google can drop it from the index. Fixing the errors restores crawling, and pages typically return once they respond normally again.
What does a status of 0 mean in a crawl report?
The crawler got no HTTP response at all. Common causes are a request timeout, a connection refused or reset by the server or firewall, a DNS failure, or a TLS/certificate error. Treat it like a 5xx and check firewall rules, timeouts and SSL configuration.
What is the difference between a 502, 503 and 504 error?
A 502 Bad Gateway means the proxy or CDN got an invalid response because the app behind it crashed or is down. A 503 Service Unavailable means the server is overloaded or in maintenance. A 504 Gateway Timeout means the app took too long to answer the proxy.
Should I use 503 or 500 when my site is down for maintenance?
Use 503 with a Retry-After header. It tells search engines the outage is temporary, so they keep the page indexed and come back later. A 500 signals an unexpected failure.
How to Fix Redirect Chains and Collapse Them to One 301
How to Fix Broken Internal Links That Return 4xx Errors
How to Fix Redirect Loops (ERR_TOO_MANY_REDIRECTS)
How to Fix Missing or Inaccurate Sitemap lastmod Dates
How to Fix 302 Redirects Used for Permanent Moves
How to Fix Non-200 URLs in Your XML Sitemap