Website Not Reachable

01

Quick diagnosis

First, identify the type of error:

ErrorMeaning
ERR_CONNECTION_REFUSEDWeb server not listening on the port
ERR_CONNECTION_TIMED_OUTFirewall blocks the port or server not responding
502 Bad GatewayNginx can't communicate with PHP-FPM or backend
503 Service UnavailableService is down or overloaded
504 Gateway TimeoutBackend (PHP, app) taking too long to respond
403 ForbiddenWrong file permissions or Nginx/Apache configuration
404 Not FoundFile not found or path configuration error
500 Internal Server ErrorApplication error (PHP, etc.)
02

1. Is the web server running?

bash
# For Nginx
systemctl status nginx

# For Apache
systemctl status apache2

# If it's down, start it
systemctl start nginx

If it won't start, see the guide: Service that Won't Start

03

2. Does firewall allow HTTP/HTTPS ports?

bash
ufw status

Ports 80 and 443 must be open:

bash
ufw allow http
ufw allow https
ufw reload
04

3. Is the web server listening on the right port?

bash
ss -tlnp | grep -E ':80|:443'

If you see no output, Nginx/Apache is not listening on those ports. Check the configuration.

05

Error 502 Bad Gateway (Nginx + PHP-FPM)

502 indicates Nginx can't communicate with PHP-FPM.

bash
# Verify PHP-FPM is running
systemctl status php8.2-fpm

# If it's down
systemctl start php8.2-fpm

# Check Nginx error log
tail -20 /var/log/nginx/error.log

Verify the .sock file in Nginx configuration matches the real one:

bash
# See available sock
ls /run/php/

# Must match what's in configuration:
# fastcgi_pass unix:/run/php/php8.2-fpm.sock;
06

Error 403 Forbidden

Most common cause: wrong file permissions on files or directory.

bash
# Fix permissions
chown -R www-data:www-data /var/www/mysite/
find /var/www/mysite/ -type d -exec chmod 755 {} \;
find /var/www/mysite/ -type f -exec chmod 644 {} \;

Another cause: index.html or index.php missing in site root.

07

Error 500 Internal Server Error

Check the error logs:

bash
# Nginx
tail -50 /var/log/nginx/error.log

# Apache
tail -50 /var/log/apache2/error.log

# Application log (Laravel)
tail -50 /var/www/mysite/storage/logs/laravel.log

Common causes:

  • PHP syntax error
  • Missing or misconfigured .env file
  • Wrong permissions on app cache or logs
  • Missing PHP module
08

Error 504 Gateway Timeout

Backend taking too long to respond. Increase timeout in Nginx:

nginx
# In server or location block
proxy_read_timeout 120s;
fastcgi_read_timeout 120s;

Also increase max_execution_time in PHP:

bash
nano /etc/php/8.2/fpm/php.ini
# max_execution_time = 120
systemctl restart php8.2-fpm
09

DNS not propagated

If site works with IP but not with domain, could be DNS propagation issue:

bash
# Verify DNS from server
nslookup example.com

# Check on external tools
# https://dnschecker.org

Wait for propagation (up to 48 hours) or verify A record is correct in your DNS panel.

DeluxHost, opgericht in 2023, biedt hoogwaardige hostingoplossingen voor diverse digitale behoeften. Wij bieden gedeelde hosting, VPS en dedicated servers met geavanceerde beveiliging en wereldwijde datacenters.

© DeluxHost, Alle rechten voorbehouden. | BTW-nummer: IT17734661006
Alle systemen operationeel