Error 522 when proxied | no problem when DNS Only [2024]

What is the name of the domain?

caersite.com

What is the error number?

522

What is the issue you’re encountering

When my DNS is proxied, I cannot connect to my self-hosted apps.

What steps have you taken to resolve the issue?

Turning off CF proxy makes my sites connectable. I’ve spent several days looking for a solution. I’m not a professional, just a hobbyist who is still learning. I’m using SWAG reverse proxy server (comes with nginx). I have another system in a different location with an identical setup, and it works perfectly fine. It’s just this domain that doesn’t work when proxied. It takes almost a minute just to connect, and when/if it does, in my browser console I see a wall of 522 errors and the site wil not load properly.

The differences are my other domain’s registrar is IONOS, and this one is with Cloudflare (figured I’d keep this one all in-house). The reverse proxies work when I have CF’s DNS proxy turned off. I also tried a temporary configuration with DuckDNS which also worked perfectly fine. But then entire point of getting this domain and using CF was to help mask the home IP.

Here is another post with someone having the same issue, but no resolution was ever found/mentioned:

What feature, service or problem is this related to?

DNS not responding/updating

What are the steps to reproduce the issue?

Step to reproduce are simply turning on DNS proxy.

Correction: The full domain is hbx.caersite.com. This is just a little home server running apps like Homebox and Immich and Mealie, stuff like that.

Hello !

in my browser console I see a wall of 522 errors and the site wil not load properly.

Error 522 occurs when Cloudflare times out contacting the origin web server.

As a resolution, contact your hosting provider to check the following common causes at your origin web server:

  • (Most common cause) Cloudflare IP addresses :arrow_upper_right: are rate limited or blocked in .htaccess, iptables, or firewalls. Confirm your hosting provider allows Cloudflare IP addresses.
  • An overloaded or offline origin web server drops incoming requests.
  • Keepalives :arrow_upper_right: are disabled at the origin web server.
  • The origin IP address in your Cloudflare DNS app does not match the IP address currently provisioned to your origin web server by your hosting provider.
  • Packets were dropped at your origin web server.

For further information, kindly review this document : Error 522: connection timed out

Thank you !

Actually, I found the solution, since I’m the hosting provider (this is just a basic homelab setup). The issue was that we are using an ASUS router that has a firewall setting called “Enable DoS Protection.” Turning that off allowed Cloudflare DNS proxy to work flawlessly. I found correlating info here for anyone who is looking:
https://www.synoforum.com/threads/external-access-cloudflare-nginx-proxy-mgr-dsm-status-522-no-reason-phrase.9625/

Cloudflare may want to add this to the Wiki since I’ve been seeing this problem with popping up lately.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.