Nginx Proxy Manager + Cloudflare reddit / selfhosted ---------------------------------------------------------------------- Warframeslut · 2023-10-29 10:08 I'm trying to set up NPM with my domain name being handled with Cloudflare and I keep getting a Error 522 code. Cloudflare's webpage states: * (Most common cause) [ Cloudflare IP addresses](https://www.cloudflare.com/ips/) are rate limited or blocked in .htaccess, iptables, or firewalls. Confirm your hosting provider allows Cloudflare IP addresses. **I'm struggling to work out how to do this properly on my debian.** * An overloaded or offline origin web server drops incoming requests. **This is not the case, I have sufficient resources and it's not offline.** * [Keepalives](http://tldp.org/HOWTO/TCP-Keepalive- HOWTO/overview.html) are disabled at the origin web server. **I don't really understand what to look for this?** * 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. **I have an A name record for** [**mydomain.com**](https://mydomain.com) **pointing to my.external.IP.address and CNAME records for my services pointing to @.** * Packets were dropped at your origin web server.The only thing I can come up with is that I need to whitelist cloudflare's IP addresses. **If I ping the site** [**npm.mydomain.com**](https://npm.mydomain.com) **it comes back successful so I don't think this is it.** If you know what I'm missing or you'd like me to provide further information or clarification, I'm all ears. ---------------------------------------------------------------------- joshikus · 2023-10-29 11:37 522 means that CF can not reach your server. How are you running Nginx? You mentioned Debian, but is this docker, built from source and running as a service, etc? Since you haven't given much information regarding your setup: - Ensure you have ports 80 and 443 for your Nginx server's internal address are port forwarded on your router/firewall. - Ensure that your Nginx server's own firewall has 80 and 443 open. ---------------------------------------------------------------------- watchdog_timer · 2023-10-29 12:26 Are you connecting to NPM over a Cloudflare tunnel, or is Cloudflare only handling your DNS? ---------------------------------------------------------------------- Warframeslut · 2023-10-31 02:27 Hi Watchdog, Thank you for your response and apologies for my late one. I 've been busy and away from PC. No tunnels at the moment just straight DNS handling. ---------------------------------------------------------------------- Warframeslut · 2023-10-31 02:42 Hi apologies for the late response and thank you for commenting. It's in a docker container in it's own stack. The ports are 3347:81 3346:80 and 313:443. In my router I have 3346, 3347, and 313 open for good measure. My linux server has 443 and 80 open via UFW. ---------------------------------------------------------------------- Warframeslut · 2023-10-31 09:15 Problem...solved? ISP Uses CGNAT so I have set up a tunnel and all is well in the world.