-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fixing "the map directive is not allowed here" at the validation stage #3478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The map directive is only allowed in the http context. See https://nginx.org/en/docs/http/ngx_http_map_module.html
Also i'm not sure if including the map block _hsts_map.conf in the templates is the best idea. It will be added mutiple times to the http context (before each https enabled server block), and sets each time the same variable ($hsts_header). |
Docker Image for build 2 is available on DockerHub as Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes. |
I had same issue with one of my proxy-hosts. I did not use HSTS but I use custom locations and some advanced settings. So the host went offline and I got After changing to image |
same issue with or without HSTS when using the server authentication for subdomains I use a custom location to authenticate against organizr for my subdomains for example: Organizr documentation using thanks |
This PR fixed mine as well. |
Fixed for me too. Thanks @derqurps. |
image jc21/nginx-proxy-manager:github-pr-3478 working. |
Bumping for visibility. I am seeing the same bug on the Truenas SCALE app. Which is on v2.11.1. |
Bump. I will try the pr version. |
just wanted to add to the confirmations that jc21/nginx-proxy-manager:github-pr-3478 i.e. this PR fixes the issue for me |
I also confirm removing the include fixed path forwarding |
Thanks for fixing. Just need a conflict fixed and then I'll merge. |
When will it be available in a new release ? |
Same problem on latest, (JUst now) can confirm that : jc21/nginx-proxy-manager:github-pr-3478 |
dear @davidindra |
Hi @mostafabarmshory, I am not the maintainer of this project, @jc21 is, so I do not know when new release will happen. Until then, you can use Docker tag jc21/nginx-proxy-manager:github-pr-3581 containing this fix and also the fix about max count of domains in proxy host :) |
Dear @davidindra |
thx for pr 3581 and 3478 fix my location problem |
Are the fixes in the latest release? |
pls push this to release |
1 similar comment
pls push this to release |
Has this been pushed to release already? |
Yes please write in this thread when its alright to stop using: :-) |
btw: issue has been fixed on v2.11.2 via #3581 At least on my system I can create custom location without any workaround needed. |
anyone can confirm that this is fixed? |
is fixed |
TLDR:
The map directive is only allowed in the http context.
See https://nginx.org/en/docs/http/ngx_http_map_module.html
Longer Description:
This map block was introduced in this commit
If the code in _hsts_map.conf is included in the _location.conf, it will be rendered inside of the server context, which produces an error at the nginx validation stage. This is because the map directive is only allowed in the http context.
I used the docker version nginx-proxy-manager:latest (a3a54016e85f)
To get to the fail (Offline) state:
Now the new proxy-host should fail and be offline.