mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #2116] Can NPM ignore nginx: [emerg] host not found in upstream error? #1524
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#1524
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 @denppa on GitHub (Jun 18, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2116
Checklist
jc21/nginx-proxy-manager:latestdocker image?Describe the bug
Nginx Proxy Manager Version
NPM shows error at container up and won't start.
To Reproduce
Steps to reproduce the behavior:
This is the errored line:
Expected behavior
Just start right up, same container and host machine.
Screenshots
no
Operating System
ubuntu 20.04
Additional context
latest pulled docker version.
compose file:
My current solution is to bomb the whole data folder and manually add back each domain, but that is a huge hassle, why doesn't the exact same data directory work?
EDIT:
Once I removed that conf file, the next conf files just continues to show the same error.
@denppa commented on GitHub (Jun 18, 2022):
Ok, so problem is that the proxy hosts have sub directories, and those are directing to hosts that are not up at that point yet. What would be a way for nginx to wait for other docker npm to just ignore the fact that they are not resolvable and just get up?
@denppa commented on GitHub (Jun 18, 2022):
Solution: use the ip address of the container so npm won't have to resolve domain names.
@eddywashere commented on GitHub (Aug 14, 2022):
Also ran into this. I didn't connect what exactly sub directories meant here. For others running into this issue, if you have any
Custom locationsor sub directories that point to a host that is down (for me it was stopped docker container on shared internal npm network) this error will occur.It's weird that npm/nginx has no issue starting up if a host is down without custom locations. I'm not sure what makes it a required dependency only as a custom location.
One workaround I did was to stop npm, edit the conf file to point to a container host that was running, and then restart.
Update: Originally I did this to add access controls on specific custom locations. Switching to $server vs hostname variable fixed this as it prevents DNS resolution at boot time. Might not work for everyone but I bet this is a common enough use case to avoid downtime.
@denppa commented on GitHub (Aug 14, 2022):
@eddywashere
Very clever solution, never thought I would ever had to use information in those lines of text.
Would you mind to show me how you defined the
$servervariable though? Is it in the text box under Advanced?I am imagining something like this:
@eddywashere commented on GitHub (Aug 15, 2022):
@Horuyuki those 3 variables including $server in the screenshot are tied to the settings of the proxy host (set in the Details tab). So reusing $server is only helpful if it happens to be the same hostname you need to reference in the custom location.
If you need to define another hostname variable to reference in custom location(s), you do need to set it in the Advanced tab when editing Proxy Host and add something like
set $custom_server nextcloud2;You have to do it that way due to the render ordering of the conf template here
github.com/NginxProxyManager/nginx-proxy-manager@4db34f5894/backend/templates/proxy_host.conf (L25)@poiNt3D commented on GitHub (Sep 7, 2022):
There is a problem with this solution. Docker uses dynamic ip addresses for containers and discourages using static ones.
@kabadisha commented on GitHub (Mar 19, 2023):
I also had this problem. I've raised a PR which I believe fixes the issue:
https://github.com/NginxProxyManager/nginx-proxy-manager/pull/2672
If anyone on this thread can test my fix, that would be really helpful.
@SimpleUserHA commented on GitHub (Jan 31, 2024):
@denppa Could this issues please be reopened or the #2672 being considered for review, since still lot's of people seem to have troubles with it.