相关文章推荐
开朗的松鼠  ·  計算函式 (DAX) - DAX | ...·  2 年前    · 
腼腆的木耳  ·  async ...·  2 年前    · 

I’m running a home server on Ubuntu with CasaOS to make things easier since I’m not great with command line stuff. I have two services running - a media request app on port 4090 and a gaming platform on port 25000 that I want my friends to access from outside my network.

I set up Nginx Proxy Manager and opened the required ports on my router. After some trial and error, I got both proxy hosts created with SSL certificates using Cloudflare DNS validation because my ISP blocks the standard HTTP ports.

The problem is when I try to reach requests.mysite.net from outside my home network, it takes forever to load and then gives me a connection refused error. But from inside my local network, the same URL works perfectly with HTTPS enabled.

What’s strange is that if I access mysite.net:4090 directly or use my public IP with the port number, it connects fine from anywhere but without SSL protection.

I’ve tried tons of different configurations and tutorials online but nothing seems to work. Could this be related to my internet provider blocking something? Any ideas what might be causing this issue?

I know Cloudflare has tunnel options but the latency is terrible for real-time applications and makes everything really slow when accessed locally.

Any help would be appreciated!

Sounds like a port forwarding issue mixed with ISP routing problems. Your direct IP works but the domain doesn’t, so the issue’s between your router’s port forwarding and how requests get handled through your domain. I ran into the exact same thing. Thought my ports were set up right, but I had to forward both port 80 and 443 to my Nginx Proxy Manager - not just the ports my apps were using. NPM needs those initial HTTPS requests on 443, then it routes everything internally. Check if your router’s got security stuff like DDoS protection or firewall rules blocking repeated external requests. Some routers see this as sketchy and start dropping connections. Try turning off the advanced security features temporarily to see if that fixes external access. Since it works internally but fails externally, and direct IP access works fine, your domain resolution’s good but traffic isn’t reaching NPM from outside your network.

It appears that your issue is likely due to a combination of DNS settings and how Cloudflare is configured. When accessing your services through your public domain and facing connection issues while the direct IP works, it often indicates that Cloudflare’s proxy may interfere with the connection, especially on non-standard ports. I encountered something similar, and a solution that helped was disabling Cloudflare’s proxy by changing the settings on their dashboard from the orange cloud to gray. This way, you can connect directly to your Nginx Proxy Manager. Ensure your router’s NAT loopback is properly configured as this can also lead to issues when accessing your internal services via external domains. Although this exposes your real IP, it could resolve the problem you’re experiencing.