Can't access VaultWarden from Nginx Proxy Manager on the same host

I have VaultWarden on the same host that Nginx Proxy Manager runs on.

CONTAINER ID   IMAGE                             COMMAND       CREATED          STATUS                    PORTS                                                                                  NAMES
5fe7c1058316   vaultwarden/server:latest         "/start.sh"   45 minutes ago   Up 44 minutes (healthy)   0.0.0.0:3012->3012/tcp, :::3012->3012/tcp, 0.0.0.0:8080->80/tcp, :::8080->80/tcp       vaultwarden
d7a7dc7a531d   jc21/nginx-proxy-manager:latest   "/init"       3 months ago     Up 9 days                 0.0.0.0:80-81->80-81/tcp, :::80-81->80-81/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   root-app-1

I can access VaultWarden directly on port (8080) since NPM is using 80 already.

I tried using the host’s IP addr, hostname, localhost, and 127.0.0.1.

What is interesting when I try using IP, Hostname it hangs for a bit (about 30 seconds) then gives me a 504 error.

when i use localhost or 127.0.0.1 I immediately get 502 error.

Make sure the two containers are in the same network. Then you should be able to refer to the vaultwarden container by its name and you also don’t need to publish vaultwarden’s ports 80/3012 either as they can be accessed via the reverse proxy.

Hey there,

I found this because this seems to be my problem - I hope, one of can figure out what is wrong!?

Containers that I have running:

portainer:							172.17.0.2	8000:8000
vaultwarden:						172.17.0.5	8016:80
nginx-proxy-manager:				172.17.0.4	8081:81
nextcloud28-app:					172.17.0.6	8060:80
mailcowdockerized-nginx-mailcow-1:	172.22.1.8	8080:8080

portainer, nginx-proxy-manager and mailcowdockerized are working!

vaultwarden and nextcloud28-app do not work!

All 5 of the above containers are member of the default bridge docker network:

… so they should see each other by using their IP addresses - but some do work and some do not and I cannot understand, what is wrong!?

Here is portainer as an example, which works like a charm:

But vaultwarden and nextcloud do look like this:

I have been trying this for 16 hours now and am very desperate :pensive:

Does anyone have any helpful ideas? I would be very grateful!

With Nginx Proxy Manager, I always use the hostname of the container, just in case of IP address changes later. But more specifically to the issue, since all the containers are on the same docker network, try using the “inside” port of the container for Vaultwarden (Port 80) on your reverse proxy entry in NPM.

Addressing hostnames of the containers is impossible, if using the default bridge network, which only supports IP addresses.

Oh, I did not know that, I typically use a docker network that I created outside of the defaults, and add access to that network for each of my containers so that they can “see” each other.

As far as accessing your Vaultwarden and Nextcloud through your reverse proxy subdomain, have you tried changing the ports for both entries to “80”, instead of 8016 and 8060?

1 Like

This is senseless, sorry. You do not seem to understand this fully.

It is intentional to use other ports than 80 and 443, because typically 80 and 443 are in use - that is also the reason for using other ports and publish them via a subdomain.

please look :point_down:

I have to say BIG sorry, because you have been right and I didn’t listen! :pray: @Jaymoon