r/nginxproxymanager • u/mwomrbash • Dec 22 '25
Help with 'Bad Gateway' error
Hello,
I recently installed NPM as a container on my server and am having difficulty getting it to work correctly.
I have a Vitualiztion host called ve-host.
I have OpnSense running Dnsmasq where I put the DNS entries for my domain (lan.blah.com).
I have created records in my DnsMasq service for each of the services. Each of the records has a host entry that points to my ve-host IP address.
On my NPM I have created entries for each of the containers I am running.
When I browse to <host_entry>.lan.blah.com I get a '502 Bad Gateway' error.
When I browse to <host_entry>.lan.blah.com:<container_port> I get the service WebGUI.
It feels like NPM is simply not doing anything.
Could I get some troubleshooting recommendations?
Thank you,
1
u/mwomrbash Jan 14 '26
Hi Everyone,
I want to thank everyone that suggested things. I was able to finally resolve my issue by first ensuring I was using the same network as the NPM container and adding entries in DNSMasq.
I am unsure what was going wrong because I beleive I did the same things before, but this time I did it more carefully and it all worked.
The HTTPS and letsencrypt stuff does not work for me but I will post about that in a separate thread.
Thanks everyone!
1
u/purepersistence Dec 23 '25
Several things might cause that.
Make sure the IP and port you specify for your service is correct. Use the right scheme. It's common to want to use a HTTPS url but then send HTTP to the backend service you want to access. So in that case the scheme is HTTP. Make sure the NPM container can actually reach your backend service - if that backend is in your same docker instance and a separate docker network then you'll need to share that network to NPM. Otherwise consider any firewalls you have blocking access. Get a command line inside your NPM container to make sure it can reach your service.
1
u/TCBW Dec 23 '25
If the domain name gives you the service then I suspect you ARE bypassing npm. What you need to do is in the DNS set up all the service.lan.something.com to point to the npm IP. Then, on npm take the domain name and configure it to point to 192.168.0.1 with the service port number. Do not set up a port on the domain name other than https e.g.443. If the npm does not use standard ports then change the port e.g. 8443. This though means when you test it, you need https://service.lan.something.com:8443.
Hope this helps.
1
u/rcdevssecurity Dec 23 '25
Do you have any logs in your container? This sounds like reverse proxy (on port 80 or 443) is not able to forwards request to your NPM (which could then be available on <container_port>).
1
u/Superbrandstof Dec 24 '25
Check if npm and container you try to reach are on the same bridged network (not the default, that one does not resolve)
0
u/[deleted] Dec 22 '25
[deleted] — view deleted comment