mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #1319] Auth_request module not behaving as expected with Organizr #1051
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#1051
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 @nathanakalish on GitHub (Aug 15, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1319
Describe the bug
When using Nginx's auth_request module in Nginx v2.9.6, the authentication behaves as expected. When updating to v2.9.7, the module does not redirect to the given subdirectory. Subdomains seem to always work fine. Authentication is using Organizr and tested by @causefx
Nginx Proxy Manager Version
Working: 2.9.6
Not Working: 2.9.7
To Reproduce
Page Error.txt
Expected behavior
subdirectory page should load the same in 2.9.6 and 2.9.7
Operating System
Docker Container via Unraid
@nathanakalish commented on GitHub (Aug 22, 2021):
Clicked the wrong button and accidentally closed the issue.
@muddro1 commented on GitHub (Nov 3, 2021):
Had same issue. When using 2.9.9 was working, when updated to 2.9.11, experienced the exact issue you were.
@ChronoStriker1 commented on GitHub (Nov 3, 2021):
Same issue, can provide logs if needed
@chaptergy commented on GitHub (Nov 3, 2021):
Not sure if I would even be able to help, but I don't really understand the issue, to be specific what the
Page Error.txtshould mean. What exactly is the error that occurs? Where does it occur? In the browser? Is it returned by some network request? Is it an error in the npm logs? Host logs?Could any of you describe what exactly the error is? If you have any helpful additional information like logs, that's probably very useful, too.
@muddro1 commented on GitHub (Nov 3, 2021):
So essentially, we all utilize organizr for auth services. Prior to the update, the setup was similar to the NPM JSON in OP, and it worked in requireing any proxy host to authenticate with organizr before providing access. After the update, it appears after providing said credentials, NPM would return the JSON in the Page Error.txt file instead of redirecting to the appropriate proxy host.
@ChronoStriker1 commented on GitHub (Nov 3, 2021):
Possibly unrelated, if I try and edit one of the services that I use this auth with and then change it back, I now get 500 Internal server errors with the console saying:
Failed to load resource: the server responded with a status of 500 () service.domain.org/:1
For the time being to get past both issues, I have had to resort to setting basic auth in NPM, which is not ideal.
@DoubtfulTurnip commented on GitHub (Nov 3, 2021):
I have managed to work around the issue by moving the auth block for organizr from the location tab to the advanced tab in NPM
Like a lot of people I was following the IBRACORP instructions on getting Organizrs auth block setup in NPM. This worked until a recent update in NPM and I have since had to apply the workaround.
Essentially I have followed the IBRACORP guide exactly the same but have moved all the location tab settings to the advanced tab.
https://ibracorp.io/server-auth-organizr-nginx-proxy-manager/
@ChronoStriker1 commented on GitHub (Nov 3, 2021):
Me trying the above workaround is how I found I am now getting the 500 error. Happens with it set or after reverting.
@DoubtfulTurnip commented on GitHub (Nov 3, 2021):
Not sure if this is anything to do with it but did you remember to also add the auth block for organizr itself but using the block as per the instructions. The block is slightly different.
This is just a wild guess though and may not be related to your issue.
@ChronoStriker1 commented on GitHub (Nov 3, 2021):
Yep, its been like that (proxy_pass address is the difference) since prior to version 2.9.6 of NPM.
@muddro1 commented on GitHub (Nov 3, 2021):
My setup has been slightly different but essentially the same as I followed organizr's instructions from their documentation. If there was any difference, it was working on 2.9.9. Main thing is the proxy pass went to : organizrv2/api/v2/auth/$1.
https://docs.organizr.app/features/server-authentication/nginx-server-authentication
@ChronoStriker1 commented on GitHub (Nov 3, 2021):
For S's and G's I have updated my settings to the current organizr documentation for a test and I still get a 500 error.
@chaptergy commented on GitHub (Nov 3, 2021):
Okay, it might have to do with the move to a variable with the proxy pass directive. Try the following, edit the
/app/templates/_location.conffile inside the container. You can do this however you wish, but you could for example connect a shell to the container and runapt update && apt install nano, and then usenanoto edit the file.Replace line 2 with the following very similar line:
Then go ahead and edit the proxy host and save, to regenerate the config file.
@causefx commented on GitHub (Nov 3, 2021):
I would assume after the change this file, they need to edit the proxy (add a comment or something) to trigger NPM to rebuild the proxy file..?
@chaptergy commented on GitHub (Nov 3, 2021):
Yes, that's correct, sorry I forgot to mention that
@ChronoStriker1 commented on GitHub (Nov 3, 2021):
I've attempted this but still get the 500, I will restore an older config backup (one that I had the actual stated issue in op) later in case the changes I have made today have broken something.
@muddro1 commented on GitHub (Nov 3, 2021):
I dont have the error 500 that Chrono is getting, but none-the-less, it did not work for me.
@ChronoStriker1 commented on GitHub (Nov 3, 2021):
After restoring my config and making that change, and then making a change to a host Im back to the original error.
@muddro1 commented on GitHub (Nov 3, 2021):
Looked at _location.conf of 2.9.9 and replaced that line 2 with what was in there (
set $upstream {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }};) but didnt work either@causefx commented on GitHub (Nov 3, 2021):
I'm gna set my test server back up and will test this.
@causefx commented on GitHub (Nov 3, 2021):
This workaround worked for my testing on version
v2.9.11 © 2019 jc21.comthe edit that i did:
Edit:
spoke too soon. while it doesn't error 500, it goes back to displaying api instead of the page.
@causefx commented on GitHub (Nov 3, 2021):
@chaptergy i did some more testing... While your edit does help set the upstream to not include the request_uri variable, the problem is 100% due to using the upstream variable in the proxy_pass directive. Why? I'm not sure... If I manually comment out the upstream variable and replace with what the variable was assigned with minus the request_uri variable all will work as expected. I will do some more testing.
@causefx commented on GitHub (Nov 3, 2021):
@chaptergy I see exactly what the issue is now. We need to use a different variable name instead of
upstreamI renamed it to :
upstreamHostand everything worked correctly. So renaming it from
upstreamto anything else - such asupstreamHostand setting your work around to remove therequest_urivariable will fix this.I edited
/app/templates/_location.confto this:@muddro1 commented on GitHub (Nov 4, 2021):
@causefx's solution worked for me
@ChronoStriker1 commented on GitHub (Nov 4, 2021):
Can confirm that worked for me as well
@dirtymike0330 commented on GitHub (Nov 4, 2021):
How would someone who uses/installs dockers via unRaid implement this solution? Are we able to edit the container as stated above as well?
@KeysAU commented on GitHub (Nov 6, 2021):
Yep same issue, hope fix comes in unraid docker image soon!
@PilaScat commented on GitHub (Nov 6, 2021):
Tried this but nothing, I hope for a fix in the next updates
@casperse commented on GitHub (Nov 12, 2021):
Any news on this, seems to still be a problem
@dirtymike0330 commented on GitHub (Nov 12, 2021):
They pushed out a new release and everything works fine for me now. Are you sure you're having the same problem as others on this thread?
@casperse commented on GitHub (Nov 12, 2021):
I think so, I followed the IBRACORP guide to setup NPM with Organizr and it just stopped working after a update.
I have updated to the latest version but I still get this when trying to access the webpage through Organizr and the NMP setup:
{
"response": {
"result": "success",
"message": "User is authorized",
"data": {
"user": "MY-SUERNAME",
"group": 0,
"email": "MY-EMAIL",
"user_ip": "IP",
"requested_group": 0
(One thing I wdont know why its says group 0 the setup provides group 1)
@causefx commented on GitHub (Nov 12, 2021):
make sure to make a change to the proxy so it re-saves. It needs to compile the conf file again.
@twitchstick commented on GitHub (Nov 16, 2021):
I'm still having an issue using this with unraid. I get the same message as casperse.
@drkgatsby416 commented on GitHub (Nov 18, 2021):
i am also having this issues after following along with the docs here: https://docs.organizr.app/features/server-authentication/nginx-server-authentication
i just get the json payload saying user is authorized and i am using a fresh install of the latest version (2.9.12)
i looked at the _location.conf file and it isnt using the "$upstream" variable already, it uses "$targetUri" and has additional logic to what is displayed in previous posts here.
update: since somebody mentioned it was working in 2.9.9 i set the docker container to pull from that version and it is working. but would be nice to have a permanent fix to i can use latest :/
@causefx commented on GitHub (Nov 18, 2021):
I'm not sure if they have merged the reversal yet
@muddro1 commented on GitHub (Dec 19, 2021):
This seems to be happening again with 2.9.12. Think this needs to be reopened.