mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #1259] Add custom config for location / {} stanza in proxy_host.conf #1020
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#1020
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 @wizkidorg on GitHub (Jul 23, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1259
Is your feature request related to a problem? Please describe.
Ability to add custom config to each hosted site's default Location / { } stanza. This is to allow use of OAuth-Proxy to do OpenID auth without the need for major changes to NPM.
Describe the solution you'd like
Add a custom include to the /app/templates/proxy_host.conf file to include and additional config file at the end of the location / {} stanza.
Currently i am using a custom dockerfile in the npm-proxy build process:
RUN sed -i 's/# Proxy!/# Proxy!\n include \/data\/nginx\/custom\/proxy_location.conf;/' /app/templates/proxy_host.confThis allows custom rules to be added to the default location / for each proxied host, to allow custom rules or plugins (in my case I'm using oauth2-proxy to utilize OpenID authentication. This is a simple addition after the above config is run in the docker for NPM.
Describe alternatives you've considered
Custom docker build.
Additional context
To Add OAuth2-Proxy to NPM after above change:
Add to docker-compose.yml:
The config file i'm using for the proxy_location.conf:
This allows simplistic OpenID integration into NPM without any major rewrites, or similar changes to OAuth2's system.
@github-actions[bot] commented on GitHub (Mar 7, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@github-actions[bot] commented on GitHub (Apr 20, 2025):
Issue was closed due to inactivity.