- Newest
- Most votes
- Most comments
When you're experiencing a Cloudflare Error 522 (Connection timed out) with your website, it means Cloudflare can establish a TCP connection to your origin server but the origin doesn't respond to the HTTP request within the allocated time. Let me help you troubleshoot this issue.
To check if your server is online and responding:
- SSH into your server if possible
- Use the curl command to test the website locally:
curl -ivL http://localhostorcurl -ivL https://tokobliss.in - If the command shows a connection timeout or refusal, there's likely an issue with your web server configuration
To check if your server is overloaded:
- Monitor system resources using commands like
toporhtopto check CPU and memory usage - Look for processes consuming excessive resources
- Check your web server logs (Apache, Nginx, etc.) for any error messages
- Review your application logs for potential issues
- Check if your database connections are functioning properly
To check if your firewall is blocking Cloudflare's IP addresses:
- Verify your EC2 instance's security group allows incoming traffic on ports 80 (HTTP) and 443 (HTTPS) from all sources (0.0.0.0/0) or specifically from Cloudflare's IP ranges
- If using an operating system firewall (like UFW on Ubuntu), check its status with
sudo ufw status numberedand ensure it allows traffic on ports 80 and 443 - For iptables, list the rules and verify they're not blocking Cloudflare IPs
Since you mentioned the issue occurs after rebooting the server, also check:
- If your web server (Apache, Nginx, etc.) is configured to start automatically on boot
- If there are any startup scripts that might be interfering with your web server
- If your application requires other services (like databases) that might not be starting properly
If all these checks pass but you're still experiencing issues, try restarting your web server service and monitoring the logs for any errors during startup.
Sources
Troubleshoot connection errors | AWS re:Post
EC2 Website Connection Timeout | AWS re:Post
Resolve website access issues in Amazon Route 53 | AWS re:Post
Relevant content
- asked 3 years ago
- asked 3 years ago
- asked 2 years ago
- asked 3 years ago
