curl -I https://yourdomain.com
top
htop
| Category | Purpose | Command / Tool | Description / Notes |
| Server Load & Performance | Check CPU, memory, and process usage | top / htop | Monitor real-time server resource usage to detect overload. |
| Check running services | systemctl status nginx / systemctl status apache2 | Ensure web server and dependent services are active. | |
| DNS Resolution | Verify domain points to correct IP | dig yourdomain.com | Checks DNS resolution and propagation. |
| Alternative DNS lookup | nslookup yourdomain.com | Confirms correct server IP. | |
| Network Connectivity | Test reachability to server | ping yourdomain.com | Checks network latency and packet loss. |
| Trace route to server | traceroute yourdomain.com | Identifies routing issues between client and server. | |
| HTTP Response Testing | Check server response codes | curl -I https://yourdomain.com | Displays HTTP headers; confirms 502 or other error codes. |
| Simulate request from server | wget --server-response https://yourdomain.com | Provides detailed request/response info for debugging. | |
| Log Analysis | Inspect server error logs | tail -f /var/log/nginx/error.log | Monitor real-time Nginx errors causing 502. |
| Apache error logs | tail -f /var/log/apache2/error.log | Monitor real-time Apache errors causing 502. | |
| Cache / Proxy | Clear local DNS cache |
Windows: ipconfig /flushdnsmacOS: sudo killall -HUP mDNSResponderLinux: sudo systemd-resolve --flush-caches | Resolves issues from outdated DNS entries. |
| CMS / Application | Disable WordPress plugin conflicts | N/A | Use WordPress dashboard or rename plugin folder via FTP/SSH. |
| CDN / Firewall | Pause or test CDN | Cloudflare Dashboard / Akamai Control Panel | Temporarily bypass CDN to check if it causes the 502 error. |
| Load Balancer / Timeout | Check upstream health | curl -I -x http://upstream-server-ip | Confirms the load balancer can reach upstream servers. |
| Adjust timeout settings |
Nginx: proxy_read_timeout 60s;Apache: ProxyTimeout 60 | Prevents premature gateway timeouts. |