When to use this guide
- Your site shows Error 522 in Cloudflare.
- The ORIV server still appears connected or reachable.
- SSH works, but the website does not load.
- External checks show port 80 or 443 is closed, filtered, or timing out.
- Cloudflare says it cannot connect to the origin server.
- Recent firewall, bot protection, fail2ban, iptables, nftables, or UFW changes were made.
[!NOTE] Precisa de ajuda visual para esta etapa? Entre em contato com o nosso suporte em support@oriv.cloud.
What the Cloudflare 522 error means
Cloudflare Error 522 means the connection from Cloudflare to the origin server timed out. The server may still be running, but Cloudflare cannot complete a web connection to the origin over HTTP or HTTPS. For most WordPress and web applications, the required web ports are:- Port 80 for HTTP traffic
- Port 443 for HTTPS traffic
- Port 22 for SSH access
Before you start
- Confirm that you have SSH or sudo user access to the server.
- Make sure you understand the impact of firewall changes before running commands.
- If you recently added custom firewall rules, keep a note of what was changed.
- Do not disable the firewall completely unless you know why and have a rollback plan.
Step 1: Confirm the site error
Open the affected domain in your browser and confirm the exact error. If Cloudflare shows Error 522, the issue is usually between Cloudflare and the origin server, not between the visitor and Cloudflare. (Screenshot: Browser showing a Cloudflare 522 timeout for the affected domain)Step 2: Check whether SSH still works
Try to connect to the server with SSH. You can use your normal SSH user, root access if available, or the ORIV sudo user feature.Step 3: Check the UFW firewall status
After you connect with SSH, run the following command:Step 4: Allow ports 80 and 443
Run these commands to allow standard web traffic:Step 5: Confirm the firewall rules were added
Run the UFW status command again:Step 6: Verify the site loads again
Open the site in your browser and refresh Cloudflare if needed. You can also test both the HTTP and HTTPS versions:http://your-domain.comhttps://your-domain.com
Step 7: Check ORIV firewall settings
After fixing the immediate issue through SSH, review the firewall configuration in ORIV.- Log in to your ORIV dashboard.
- Open the affected server.
- Go to Security → Firewall Management.
- Confirm that HTTP on port 80 is allowed.
- Confirm that HTTPS on port 443 is allowed.
- Review any custom deny rules that may have been added recently.
If ports are allowed but the site still shows 522
If UFW shows ports 80 and 443 as allowed but the site still does not load, check whether the web server is listening on those ports.Common causes
- A custom firewall command removed existing allow rules.
- UFW was enabled without adding HTTP and HTTPS rules.
- An anti-bot or emergency firewall change blocked web traffic.
- A deny rule was added before the allow rules.
- A server cleanup or hardening command modified iptables, nftables, or UFW rules.
- The web server service stopped responding after configuration changes.
Prevention tips
- Before enabling UFW, allow SSH, HTTP, and HTTPS.
- Keep SSH open so you do not lock yourself out.
- Avoid running copied firewall cleanup commands without reviewing them.
- Document any custom firewall rules added for bot protection.
- After changing firewall rules, test the website from an external network.
- Use ORIV Firewall Management for standard port rules when possible.
