Question
How to fix Cloudflare 521 web server down
521 usually means Cloudflare reached your origin IP but the connection was refused.
First checks
- Confirm your web process is running.
- Confirm 80/443 are listening on origin.
- Check firewall and cloud security groups for edge IP blocks.
If origin is reachable but Cloudflare still reports an unknown error, continue with Cloudflare 520 unknown error.
sudo systemctl status caddy --no-pager -n 20
sudo systemctl status nginx --no-pager -n 20
sudo ss -lntp | grep -E ':80|:443'
sudo ufw status