[GH-ISSUE #334] Proxying NPM itself won't work when enabling ACL #292

Closed
opened 2026-02-26 06:32:05 +03:00 by kerem · 7 comments
Owner

Originally created by @eladent on GitHub (Mar 21, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/334

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    Yes
  • Are you sure you're not using someone else's docker image?
    Yes
  • If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network?
    Yes

Describe the bug
I use npm with portainer as a generic reverse proxy. It works perfectly, except... for NPM itself.
If i try to redirect "npm.mydomain.tld" to ":81" in order to get it accessible from network where only HTTP(S) port is reachable. I'll will land to the login page, but i get an unauthorized error when giving the credentials.

To Reproduce
In npm, create a new proxy host that redirect a domain to the npm internal IP:port.
Exemple : "npm.exemple.com" redirect to http://:81

Expected behavior
NPM should be able to redirect himself.

Screenshots
image

Operating System

  • Debian 10 : up to date.

Additional context
NPM running from a portainer, working fine with every over host on the server.

Thanks in advance!

Originally created by @eladent on GitHub (Mar 21, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/334 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? Yes - Are you sure you're not using someone else's docker image? Yes - If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network? Yes **Describe the bug** I use npm with portainer as a generic reverse proxy. It works perfectly, except... for NPM itself. If i try to redirect "npm.mydomain.tld" to "<internalIP>:81" in order to get it accessible from network where only HTTP(S) port is reachable. I'll will land to the login page, but i get an unauthorized error when giving the credentials. **To Reproduce** In npm, create a new proxy host that redirect a domain to the npm internal IP:port. Exemple : "npm.exemple.com" redirect to http://<npm-docker-ip>:81 **Expected behavior** NPM should be able to redirect himself. **Screenshots** ![image](https://user-images.githubusercontent.com/17823045/77223098-d2bbb600-6b59-11ea-9480-2a5e42175f9c.png) **Operating System** - Debian 10 : up to date. **Additional context** NPM running from a portainer, working fine with every over host on the server. Thanks in advance!
kerem 2026-02-26 06:32:05 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kymodoke commented on GitHub (Mar 21, 2020):

It does works. Tagging this question with the label "bug" is a bit too early... as it's probably just some misunderstanding about networks.

On my installation I do redirect port 81 of the NPM admin page to a HTTPS connexion on a domain.

Things is just don't do that redirdection/proxy to a real domaine name, but instead I use the container name itself as Forward Hostname

For instance on my installation, my NPM container name is "nginx-proxy-manager_app_1"

Capture de 2020-03-21 17:08:07

So I set up this Proxy Host as below with the container name:

Capture de 2020-03-21 17:04:41

And it does work. The proxy will recognize this endpoint and find from the docker network... and everything else works.

Capture de 2020-03-21 18:48:49

It's also the way I do proxy other containers to HTTPS domains.

Note: you can even remove the port 81 from the publically mapped port. The proxy will be able to access it anyway, so you'll have your admin accessible only from SSL.

<!-- gh-comment-id:602066058 --> @kymodoke commented on GitHub (Mar 21, 2020): It does works. Tagging this question with the label "bug" is a bit too early... as it's probably just some misunderstanding about networks. On my installation I do redirect port 81 of the NPM admin page to a HTTPS connexion on a domain. Things is just don't do that redirdection/proxy to a real domaine name, but instead I use the container name itself as Forward Hostname For instance on my installation, my NPM container name is "nginx-proxy-manager_app_1" ![Capture de 2020-03-21 17:08:07](https://user-images.githubusercontent.com/45711985/77230759-c99d0a00-6b96-11ea-892e-a6ea58bab9f5.png) So I set up this Proxy Host as below with the container name: ![Capture de 2020-03-21 17:04:41](https://user-images.githubusercontent.com/45711985/77230689-3c59b580-6b96-11ea-832f-80e77239f707.png) And it does work. The proxy will recognize this endpoint and find from the docker network... and everything else works. ![Capture de 2020-03-21 18:48:49](https://user-images.githubusercontent.com/45711985/77232993-c872d980-6ba4-11ea-9eb8-b35a0f5e6043.png) It's also the way I do proxy other containers to HTTPS domains. Note: you can even remove the port 81 from the publically mapped port. The proxy will be able to access it anyway, so you'll have your admin accessible only from SSL.
Author
Owner

@miguelwill commented on GitHub (Mar 21, 2020):

in my case I had the same problem when I wanted to use port 81 access and add an ACL with a previous username and password
after this the login shows error, I think NPM is reading the user from the http session instead of the login form

When I disabled the ACL on dashboard access, the access worked normally

<!-- gh-comment-id:602115918 --> @miguelwill commented on GitHub (Mar 21, 2020): in my case I had the same problem when I wanted to use port 81 access and add an ACL with a previous username and password after this the login shows error, I think NPM is reading the user from the http session instead of the login form When I disabled the ACL on dashboard access, the access worked normally
Author
Owner

@eladent commented on GitHub (Mar 22, 2020):

@miguelwill, thanks that's it ! You can't "auto-proxy" NPM with an access-list.
@kymodoke it solve the problem for me, but it's a bug. As far as i'm concerned : at least, it should be documented if not supported by NPM or fixed.
Anyway Thanks for your help !

<!-- gh-comment-id:602168737 --> @eladent commented on GitHub (Mar 22, 2020): @miguelwill, thanks that's it ! You can't "auto-proxy" NPM with an access-list. @kymodoke it solve the problem for me, but it's a bug. As far as i'm concerned : at least, it should be documented if not supported by NPM or fixed. Anyway Thanks for your help !
Author
Owner

@kymodoke commented on GitHub (Mar 22, 2020):

@eladent I do agree with you about the lack of documentation. There is a short doc about installation but quite nothing about usage.
I use NPM for less than a week, and I had to discovered several things about its usage by personal trial and errors...

<!-- gh-comment-id:602169838 --> @kymodoke commented on GitHub (Mar 22, 2020): @eladent I do agree with you about the lack of documentation. There is a short doc about installation but quite nothing about usage. I use NPM for less than a week, and I had to discovered several things about its usage by personal trial and errors...
Author
Owner

@Raito00 commented on GitHub (Jun 3, 2021):

I have the same problem with Auth Loop only for NPM login ... V.2.9.3

<!-- gh-comment-id:853802920 --> @Raito00 commented on GitHub (Jun 3, 2021): I have the same problem with Auth Loop only for NPM login ... V.2.9.3
Author
Owner

@shaulliv commented on GitHub (Nov 23, 2021):

For me this also happens when I try to access list Portainer (exact same behavior).

<!-- gh-comment-id:976303518 --> @shaulliv commented on GitHub (Nov 23, 2021): For me this also happens when I try to access list Portainer (exact same behavior).
Author
Owner

@Danie10 commented on GitHub (Dec 22, 2021):

I've been going around in circles for hours until I found this bug report. If it is not meant to be that we use ACL with access to NPM itself, why not just document it (as someone else has suggested)? The same goes for the changing ACL settings and having to save the proxy hosts again for it to take. These are frustrations that would save many people hours, if they were just documented in FAQ or the documentation (at least until resolved at some later stage).

<!-- gh-comment-id:999672837 --> @Danie10 commented on GitHub (Dec 22, 2021): I've been going around in circles for hours until I found this bug report. If it is not meant to be that we use ACL with access to NPM itself, why not just document it (as someone else has suggested)? The same goes for the changing ACL settings and having to save the proxy hosts again for it to take. These are frustrations that would save many people hours, if they were just documented in FAQ or the documentation (at least until resolved at some later stage).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#292
No description provided.