mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 01:15:51 +03:00
[GH-ISSUE #5335] Parse /etc/hosts to allow using synonyms for IP addresses #3174
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#3174
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 @adrifromhh on GitHub (Feb 21, 2026).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/5335
Is your feature request related to a problem? Please describe.
NPM seems to ignore the
/etc/hostsfile, so it's impossible to use a concise name for your proxy HostsForward Hostname / IP. That would be very helpful in a setup where the forward hosts are not docker containers, or on a different docker host.Describe the solution you'd like
Please make NPM resolve addresses in the /etc/hosts file, so with the following addition to the Docker-Compose file, we could use synonyms for hosts IP addresses:
This adds hosts to the containers internal
/etc/hostsfile.Best wishes
Adrian
@jc21 commented on GitHub (Feb 25, 2026):
In this project, Nginx is using a
resolverdirective which is generated on startup. It's usually something like thisWhen doing this, Nginx ignores the
hostsfile for resolution.From researching, I don't think there's any nginx-supported workaround for this. One possible option is to have the NPM project read from the hosts file on startup and create upstreams in nginx config, but that's a bit of a refactor.
@jc21 commented on GitHub (Feb 25, 2026):
I suppose another option is to disable the resolver generation with a env var. It might work for you
@jc21 commented on GitHub (Feb 25, 2026):
My commit message was
Attempt to fix #5335 ..but github thought this means it's actually resolved.If you'd like to test with the following image and env var:
let me know if that works for you