Help with setting up Nginx Proxy Manager

I've gotten myself a libre computer aml-s905x-cc and put their headless ubuntu image on it and I'm trying to set up a self-hosted environment for Bitwarden.

I've got Docker on it and I'm running Portainer to help manage the docker containers. That's working fine.

I've gotten a domain from google domains and set up a dns resource for "test.mydomain.com" pointing to my public IP address.

I've tried using the quick setup guide for Nginx Proxy Manager (npm) from here: https://nginxproxymanager.com/guide/#hosting-your-home-network. Everything seems to work correctly. I've got it installed, I've set up the admin account, I've created an SSL cert for test.mydomain.com, set up the proxy host for a test nginx container.

The problem is that I cannot access test.mydomain.com from within my network. I can access it from my phone with wifi turned off, and I've had someone else say they can access it from their network. In these cases we get the default nginx landing as expected. But from within my home network, I just get a timeout error and nothing shows up in any of the logs.

I think what I need is NAT loopback? But I don't think my router or modem supports it. I've got a router/modem combo from xfinity (thats pretty busted. there are port forwards that throw errors when I try to clean them out in their xFi app, and bridge mode doesn't work), and a tplink Archer A6 router. Neither seem to have any options for this. I'm new to this self hosting stuff, and I haven't done much else on my server other than what I listed above.

Posted Sep 2, 2022, 6:56 PM UTC

24
driedpoop33•

Run an internal DNS server and point it to the local IP address.

4
numenizationOP•

Yep this works. Installed PiHole to use as the DNS server and it works perfectly.

3
Tropaia•

Did you forward your ports (80,443 and bitwarden needs 3012, 8060) to your server?

Do you have dynamic ip? Then you should use DDNS and CNAME.

2
Akaitensi•

As others have provided a solution I will try to explain the problem. This is a NAT reflection problem. You have opened port 80 and 443 on your router and port forwarded (NAT) the ports to the machine running npm. When accessing test.domain.tld from outside your LAN packets hit the NAT rule and get routed correctly. But from inside your LAN these packets will not hit the rule due to NAT reflection and try to go for your routers webpage most likely. Solution 1 is to disable NAT Reflection but that will break a lot of things and is generally not a good practice. Solution 2 is to setup a DNS server inside your network to tell your LAN to resolve test.domain.tld to local IPs instead of the public one. This is called Split DNS.

Hope that helps! Have fun exploring self hosted apps and learning along the way

EDIT: If your router is trash and you don't want to spend money on a new one then your next self hosting project should be pfSense. There are many good guides that cover most of the things you need to learn. It will give you many more options and teach you a great deal about networking.

2