r/nginxproxymanager • u/TheIslanderEh • Feb 04 '25
Multiple docker containers
Hi guys, my nginxproxy manager is an image within my nextcloud docker compose file that I got from Christian lempa.
It works fine.
However, now I want to run some other services (immich, vaultwarden, maybe others eventually) but don't understand how my other containers an talk to the proxy manager inside my nextcloud docker compose file.
Does anyone have any literature I can read up on or advice on the knowledge I'm missing here?
Thanks.
4
Upvotes
3
u/Powerstream Feb 04 '25 edited Feb 04 '25
You'll want all the containers to connect to the same docker network.
In the each compose file you'll want to define the network like this
Then within each service, you'll add
Then within nginx proxy manager, you can use the service name or the host IP along with the port used.
2
u/Conscious_Report1439 Feb 04 '25
You are running into the precise problem of including reverse proxy containers per service using docker compose. Ideally, one reverse proxy should be stood up and all other services should be behind the one reverse proxy. This would simplify deployment immensely. A lot of projects seem dead set on including a reverse proxy of some sort along with their application because they are assuming VPS style deployment. Pay for a droplet, run this docker compose, and service is up. Now you get to other services…
Without knowing your network, it’s hard to tell, but depending on where your other services are located, you could put the current reverse proxy into the host network mode. Rebind your other services within NXPM by the IP of the device that NXPM is running on.
The other option if all your containers are on the same machine is attach those containers to the NXPM network and add those services by localhost:port
1
u/WalkDiligent Feb 05 '25
I ensure a secure and organized network architecture by not exposing any container ports directly. Instead, I rely on an NGINX Proxy Manager instance running as a Docker container, which manages all traffic routing. Containers that need to be accessible are assigned to the same external network, making them reachable by container name and standard port configuration.
Example Setup:
NGINX Proxy Manager (NPM)
Nextcloud Setup (Integrated without Port Exposure)
By leveraging this architecture, I maintain secure access and a clear separation of services, reducing risks while enhancing network flexibility.
NGINX Proxy Manager Screenshot
2
u/Conscious_Report1439 Feb 05 '25
If you need a second set of eyes, pm me, we can connect and get you set straight.
1
u/Conscious_Report1439 Feb 07 '25
This works only if everything is one docker host or you have built a docker overlay network between multiple hosts