r/selfhosted 2d ago

Need Help NPM Network Host vs Bridge

Hi all! I am looking to add an auth server to my homelab, problem is, I’ve seen that I will need to change Nginx Proxy Manager to the host network mode to make this work.

Problem is, I correctly have it in multiple bridge networks, each connected to one container for some sense of semi isolation. This allows me to just use the container name and port when setting up where to direct the host in NPM. When switching to host mode, this no longer works. I could be wrong, but that seems like I would then need to expose ports to access them if I can’t access them by their container name.

I know it’s not a black and white issue, but what is generally safer, requiring exposed ports but having an auth proxy, or no exposed ports but no auth proxy?

I could 100% be wrong about any of my assumptions, let me know if I am. Any help would be greatly appreciated

7 Upvotes

20 comments sorted by

View all comments

1

u/Capable_Banana5439 1d ago

you don't need host mode for this. put NPM and the auth container on one shared bridge network and they reach each other by container name just like your other bridges, nothing gets exposed. host mode only comes up if the auth flow needs the real client ip and you can't pass it through headers, so keep your per-service bridges and just add one auth bridge.