Common Nginx Errors and Fixes

1 min read

Authors
banner

Common Nginx Errors

502 Bad Gateway

Cause: Backend server down or unreachable

Fix:

# Check backend
curl http://backend:3000

# Check upstream
sudo nginx -t

504 Gateway Timeout

Cause: Backend too slow

Fix:

proxy_read_timeout 60s;
proxy_connect_timeout 60s;

403 Forbidden

Cause: Permission issues

Fix:

# Check file permissions
ls -la /var/www/html

# Check SELinux
getenforce

Fixed!

© 2025 Vijay Rajendran