mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 01:15:51 +03:00
[GH-ISSUE #148] Proxy Host Custom Locations do not apply Access Lists #131
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sadowski on GitHub (May 22, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/148
I expect that if I apply an Access List to a Proxy Host, and then add a Custom Location to a proxy host, that when I go to that location for the first time, I am asked to supply authorization. This does not happen. The Custom Location is accessible without a username and password.
To reproduce:
Expected Result:
You are asked to supply username and password via basic auth.
Actual Result:
The page loads without authorization.
@jc21 commented on GitHub (May 22, 2019):
ahh yeah definitely an oversight
@emko commented on GitHub (Jul 3, 2019):
can we enable the auth in custom ngix configuration?
@meiskam commented on GitHub (Aug 3, 2019):
It'd be nice to have Access List box show up for each custom location, so I can have a custom location with a password and the main bit without one
@jValdron commented on GitHub (Aug 6, 2019):
@meiskam, just add the following to your custom location "advanced options":
Taken from the proxy_host.conf template: https://github.com/jc21/nginx-proxy-manager/blob/master/src/backend/templates/proxy_host.conf
@jgearinger commented on GitHub (Dec 3, 2019):
still an issue... creates a pretty big security hole if you do not test specifically for this issue.
@ahknight commented on GitHub (Feb 11, 2020):
I just ran into this as I wanted different levels of access for different apps on a domain. It’s also not easy to find out the ACL ID remotely (VPN, browser only) so I had to go guessing. It’d be nice to have a menu for each custom location to pick the ACL for it and have it just insert that blob.
@wtf911 commented on GitHub (Apr 15, 2020):
Would also like to see this fixed please!
@clb92 commented on GitHub (May 15, 2020):
This is actually a pretty big issue for me, that locations don't inherit the host's access control.
I can't even get the solution above (adding auth_basic and auth_basic_user_file to the custom location) to work correctly:
If I use same access list on both host and location
My host
subdomain.domain.comgoes to one web server. It hasaccess list 0added to it through the dropdown list selector.My custom location
/subdirgoes to another web server. It also hasaccess list 0added, by the two lines in the custom location config.If I visit
subdomain.domain.com/and authenticate, that site displays fine, but if I then go to/subdir/, I always get 403 Forbidden.If I visit
subdomain.domain.com/subdir/directly (without authenticating onsubdomain.domain.com/first), it will ask me to authenticate, but then I still get 403 Forbidden on, no matter what I do.If I use different access lists on host and location it works
My host
subdomain.domain.comstill hasaccess list 0added to it.But now, custom location
/subdirhasaccess list 1added instead.Now it works more as expected. Navigating to
subdomain.domain.comasks for auth, and then going tosubdomain.domain.com/subdir/also asks for auth (but different credentials).Navigating between the pages, it will keep asking for auth, since you can apparently only be authenticated with one set of credentials on one domain. This is expected.
The problem?
Studying the Docker container log, I see this line when I save the proxy settings through the GUI:
No idea if it's related.
So, is it just a bug in NPM that a host and a location (on that same host) can't use the same access list?
If anyone knows how to fix this, please let me know.
EDIT: For now, I can have the same access list on the host and location by actually making another access list (with same list of credentials in it) and using one list on the host, and the clone on the location. Works for now, but it's a terrible solution.
@colonelmattyman commented on GitHub (Sep 3, 2020):
Websockets on Custom Domains are also broken because of this. I really think that this bug needs some urgent attention and a fast resolution. It's been open since 23 May 2019.
@Tezzlicious commented on GitHub (Sep 3, 2020):
Must agree. Issue needs an urgent fix or needs to be mentioned on the homepage. Thanks for the efforts.
@colonelmattyman commented on GitHub (Sep 10, 2020):
I ended up rolling back to V1.5.0 to fix it.
@clb92 commented on GitHub (Sep 10, 2020):
Random small problems like these have made me switch to Caddy. Sorry jc21!
@colonelmattyman commented on GitHub (Sep 11, 2020):
Right? Although I don't think a lack of authentication should be classed as a small problem.
@ghost commented on GitHub (Feb 14, 2021):
How has this bug been open for almost 2 years?
@NovaViper commented on GitHub (Feb 16, 2021):
Is there a fix for this??? I have a mission-critical sever that requires basic auth and it doesn't even run without custom locations; it seems to be broken for me entirely. Using v2.8.0
@fistwho commented on GitHub (Mar 5, 2021):
No Update so far? @jc21
@Kooramah commented on GitHub (Mar 10, 2021):
I just ran into this issue myself, any updates on whether this will be fixed or not
@failserver commented on GitHub (Mar 21, 2021):
Just ran into this same issue with trying to setup guacamole with a custom location. Access list are not applying to the proxy host.
@markspivey commented on GitHub (Jun 3, 2021):
Lucky I found this thread because I initially thought this was an issue on my end. But just to reiterate that this solution above does solve the issue. As a working example, I added the following to advanced options for each of my custom locations (based on my personal preferences when setting up the access list):
auth_basic_user_file /data/access/1; would correspond to the respective file/access list you want to use.
@investlab commented on GitHub (Sep 13, 2021):
How can i enable basic auth sitewide and disabling it for subpages?
Anyone can access sub-location without Basic Authorization.
@TheClockTwister commented on GitHub (Oct 4, 2021):
As of
v2.9.9, this seems to be an issue that wasn't completely eliminated in #1081...If I create a clean instance of the image and use a basic proxy host with access list using Basic Auth, the file in
/data/access/xxxis created, but not included in the proxy host's configuration. After manually adding the following block as suggested by @markspivey, everything works fine...Thanks for this awesome project! I hope this bug will be fixed for good... :)
@aw-jansen commented on GitHub (Jun 15, 2022):
@ksarnelli commented on GitHub (Dec 9, 2022):
@investlab @aw-jansen
Did either of you guys ever figure this out? Adding
auth_basic "off";to a location's custom config seems to put the host into Offline mode for me.@aw-jansen commented on GitHub (Dec 10, 2022):
Unfortunately it worked only when using the manual configuration to
configure the whole domain. Far from ideal however.
On Fri, Dec 9, 2022, 23:18 ksarnelli @.***> wrote:
@ksarnelli commented on GitHub (Dec 10, 2022):
Bummer - that was my suspicion. Thanks!
@alneven commented on GitHub (May 14, 2023):
any idea why I have this in the logs? (I'm on docker, with version v2.10.3)
@natechoiniere commented on GitHub (Sep 5, 2023):
I'm also seeing this.
@kpleines commented on GitHub (Dec 14, 2023):
Same here.
V2.10.4
@vtmocanu commented on GitHub (Dec 17, 2023):
can you please share an example of the manual config for the whole domain?
@W1BTR commented on GitHub (Jun 30, 2025):
Same issue here! Rather annoying
@W1BTR commented on GitHub (Jun 30, 2025):
Adding
Causes it to fail and show that host as "offline" for me, unfortunately.
I also tried having that chunk of code, plus disabling the access list from the main gui page, which now does prompt for a login but says "unauthorized" even after signing in.
@SmileMachine commented on GitHub (Oct 23, 2025):
Add the above to "Advanced", but not "Custom Locations"
After that, set the "Access List" to be "Publicly Accessible"
Also, make sure the access_list_id is correct.