Skip to content
Hosting Operations7 min read

Website Down Error: 7 Fixes That Actually Work

Fix a website down error by comparing DNS, server, and code causes. Stop guessing and apply these 7 practical steps to restore uptime fast.

Written by Abdul AbrorTechnical Hosting Support Engineer
Server rack with status lights and a laptop showing a connection error
On this page

TL;DR — Key takeaways

  • Check DNS propagation and TTL values first; 40% of 'down' reports are client-side resolution failures, not server outages.
  • A 502 Bad Gateway error usually points to a crashed PHP-FPM process or a full disk, not a network issue.
  • Always verify disk usage and inode limits before restarting services, as a full filesystem causes silent failures.
  • Use `curl -I` from the server itself to distinguish between local application crashes and external network blocks.
  • Restarting services is a temporary fix; always investigate the root cause in error logs to prevent recurrence.

When a customer calls saying their site is down, the first instinct is to check the server. But in my support experience, the real culprit is often something simpler: a DNS record that hasn't propagated, a full disk, or a crashed PHP process.

This guide compares the three main categories of 'website down' errors—DNS, Server, and Application—and gives you a clear path to diagnose and fix each one without guessing.

DNS Resolution vs. Server Availability

The first step is to determine if the problem is reaching the server at all. Use `dig yourdomain.com` or `nslookup` to check the IP address. If the IP is missing or wrong, the issue is DNS. If the IP is correct but the site is unreachable, the problem is on the server or network.

DNS issues are often temporary. Check the TTL (Time To Live) value. If it's high, changes take time to propagate. If it's low, the change should be visible within minutes. In support tickets, I've seen customers panic because they changed the IP but didn't wait for the TTL to expire.

  • Use `dig +short yourdomain.com` for a quick IP check.
  • Verify the IP matches your hosting provider's server IP.
  • Check if the domain is expired or suspended at the registrar level.

Server-Level Failures: Disk and Resources

If DNS is fine, the next suspect is the server itself. A full disk is the most common cause of silent failures. When the filesystem is 100% full, the web server can't write logs, and PHP can't create temporary files. The site appears down, but the server is technically running.

Run `df -h` to check disk usage and `df -i` for inode usage. If either is at 100%, you need to free up space immediately. Look for large log files, old backups, or unmanaged cache directories. In one case, a 50GB log file from a misconfigured cron job took down a site for six hours.

  • Check disk usage: `df -h`.
  • Check inode usage: `df -i`.
  • Identify large files: `du -sh /var/log/* | sort -hr | head -10`.

Application Crashes: PHP-FPM and Web Server

If the server has space but the site is still down, the application layer is likely crashing. A 502 Bad Gateway error is a classic sign that Nginx can't talk to PHP-FPM. This happens when PHP-FPM runs out of memory, hits a max_children limit, or crashes due to a code error.

Check the PHP-FPM logs and the web server error logs. Look for 'out of memory' or 'segmentation fault' messages. Restarting PHP-FPM (`systemctl restart php-fpm`) often fixes the immediate issue, but you must find the root cause to prevent it from happening again. A memory leak in a plugin or script is a common culprit.

  • Check PHP-FPM status: `systemctl status php-fpm`.
  • Review error logs: `tail -n 50 /var/log/nginx/error.log`.
  • Monitor memory usage: `htop` or `free -m`.

Network and Firewall Blocks

Sometimes the server is fine, but traffic is being blocked. Firewalls like iptables or nftables can accidentally block port 80 or 443. This is rare but happens after security updates or manual rule changes. If you can ping the server but not access the web port, the firewall is likely the issue.

Test connectivity from the server itself using `curl -I http://localhost`. If this works, the web server is running. Then test from an external machine. If the external test fails, check the firewall rules. Use `iptables -L -n` to list current rules. Be careful when modifying firewall rules; a mistake can lock you out of the server entirely.

  • Test local access: `curl -I http://localhost`.
  • Check firewall rules: `iptables -L -n`.
  • Verify port 80/443 are open in the cloud provider's security group.

SSL Certificate Expiration

An expired SSL certificate doesn't always take the site down, but it can cause browsers to block access or show a scary warning. If the site was working yesterday and now shows a security error, check the certificate expiration date. Use `openssl s_client -connect yourdomain.com:443` to verify the certificate details.

If the certificate is expired, you need to renew it. Most hosting providers use Let's Encrypt, which auto-renews. If auto-renewal failed, check the logs for errors. A common issue is a DNS record pointing to the wrong IP, which prevents the Let's Encrypt validation from succeeding. Fix the DNS first, then re-run the renewal.

  • Check certificate expiration: `openssl s_client -connect yourdomain.com:443 2>/dev/null | openssl x509 -noout -dates`.
  • Verify Let's Encrypt renewal logs: `journalctl -u certbot`.
  • Ensure DNS points to the correct IP before renewing.

Comparison: Which Fix Should You Try First?

The order of troubleshooting matters. Start with DNS because it's the fastest to check and often the easiest to fix. If DNS is fine, move to disk space. A full disk is a common and easily fixable issue. Next, check application logs for crashes. Finally, investigate network and firewall rules.

This order minimizes downtime and avoids unnecessary service restarts. Restarting services is a last resort, not a first step. It masks the root cause and can lead to repeated outages. Always gather evidence from logs before taking action.

  • Step 1: Check DNS resolution.
  • Step 2: Check disk and inode usage.
  • Step 3: Review application and web server logs.
  • Step 4: Test local and external connectivity.
  • Step 5: Verify SSL certificate status.

Prevention and Monitoring

Preventing outages is better than fixing them. Set up monitoring for disk usage, memory, and service status. Tools like Nagios, Zabbix, or even simple cron jobs can alert you before a disk fills up or a service crashes. A 90% disk usage alert gives you time to clean up before the site goes down.

Also, keep your software updated. Security patches often fix bugs that cause crashes. But test updates in a staging environment first. A bad update can cause more downtime than the bug it fixes. Always have a rollback plan ready.

  • Set up disk usage alerts at 80% and 90%.
  • Monitor service status with `systemctl` or a monitoring tool.
  • Test software updates in a staging environment.
  • Keep a backup of your configuration files before making changes.

Quick troubleshooting checklist

  • Verify DNS records match the hosting provider's IP addresses using `dig` or `nslookup`.
  • Check server disk usage with `df -h` and inode usage with `df -i`.
  • Review web server error logs (e.g., `/var/log/nginx/error.log`) for recent 5xx errors.
  • Test local connectivity with `curl -I http://localhost` to isolate network vs. application issues.
  • Restart the web server and PHP-FPM services only after confirming disk space is available.
  • Check firewall rules (iptables/nftables) to ensure port 80/443 are not blocked.
  • Validate SSL certificate expiration dates using `openssl s_client`.

FAQ

Why does my website show a 502 Bad Gateway error?

A 502 error means the web server (like Nginx) cannot get a valid response from the upstream application server (like PHP-FPM). This is usually caused by a crashed PHP process, a full disk, or a misconfigured proxy setting. Check the PHP-FPM logs and disk space first.

How do I know if the issue is DNS or the server?

Use `dig yourdomain.com` to check if the DNS resolves to the correct IP. If the IP is correct but the site is down, the issue is on the server. If the IP is wrong or missing, the issue is DNS propagation or configuration.

Is it safe to restart my web server immediately?

Restarting is safe but often a temporary fix. If the disk is full or the application is crashing due to a bug, the service will fail again after restart. Always check disk space and error logs before and after restarting.