Secure Admin URL #2547
-
|
I was unable to find a solution by searching (re: Vaultwarden and NPM solutions) and I apologize if I missed something obvious. I'm using Docker and Nginx Proxy Manager. All seems to be working very well, but I'm trying to increase security after the fact. I'm new to both Docker and NPM, so this is probably my real problem! I would like to limit access to the /admin (sub) URL by IP address...because that's how I have done things in the past. In the past, I have used .htaccess files to limit access to subfolders. If this is a good way to secure the Vaultwarden /admin location, can someone please tell me where that should be located? Nginx Proxy Manager may have the functionality I'm looking for, but my attempts have all failed (proxy host offline). This is approximately what I'm looking for: Can someone point me in the right direction? Thanks in advance, G |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
|
See https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples |
Beta Was this translation helpful? Give feedback.
-
|
Is this still bothering you? As you noticed yourself, proxying requests to another application (in this case vaultwarden) is fundamentally different from serving content with a webserver. This is why you cant use .htaccess files or similar. You are right, the best way to achive this is to manage restrictions in your reverse-proxy. The policies in your example are correct. |
Beta Was this translation helpful? Give feedback.
-
|
OK, I got this sorted. What I wanted to do is protect an admin URL while leaving the web app publicly accessible. This should work with most apps. With apps that have their admin interface on a different port (ex. Webmin on port 10000), I just don't expose the admin interface port in NPM. This example is for an app that just uses /admin (or something like that on port 80 or 443) to access the web admin interface. In general, it's best to never expose admin URLs to the Internet. This worked for me running Vaultwarden on Docker (in DMZ and no NAT from LAN): In NPM, starting with a working "proxy host", I added a "custom location" just pointing to port 80 (where the traffic went previously) :
(Everything should work just as before at this point, if you were to test it.) Then I clicked the (custom location) gear icon where one enters custom configuration and entered: Now, I can access the /admin URL from my LAN, but not from outside. If the web app is on a public host, you would use your external IP address instead of the (192.168.0.0/24) LAN address for the allow. I hope that makes sense for anyone that finds this page. Thanks much for the replies @Masgalor and @BlackDex! G |
Beta Was this translation helpful? Give feedback.
-
|
@sonoracomm this is how I'm doing in NPM GUI, |
Beta Was this translation helpful? Give feedback.
-
|
only worked with image: jc21/nginx-proxy-manager:github-pr-3478 |
Beta Was this translation helpful? Give feedback.

OK, I got this sorted.
What I wanted to do is protect an admin URL while leaving the web app publicly accessible. This should work with most apps.
With apps that have their admin interface on a different port (ex. Webmin on port 10000), I just don't expose the admin interface port in NPM. This example is for an app that just uses /admin (or something like that on port 80 or 443) to access the web admin interface. In general, it's best to never expose admin URLs to the Internet.
This worked for me running Vaultwarden on Docker (in DMZ and no NAT from LAN):
In NPM, starting with a working "proxy host", I added a "custom location" just pointing to port 80 (where the traffic went previously) :
…