mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #1807] setup nginx not to crash if host in proxy pass not found #1337
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#1337
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 @pecqueurS on GitHub (Jan 26, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1807
Is your feature request related to a problem? Please describe.
When the proxy_host is used to proxy a docker container and this container is shut down afterwards, if you restart nginx-proxy-manager, it generates an error because the domain no longer exists. Nginx-proxy-manager can no longer launch.
Describe the solution you'd like
Modify the proxy pass option in nginx
actual :
proxy_pass http://:/;
proposal :
No stop when error on config
https://stackoverflow.com/questions/32845674/setup-nginx-not-to-crash-if-host-in-upstream-is-not-found/32846603#32846603
https://stackoverflow.com/questions/35744650/docker-network-nginx-resolver/37656784#37656784
resolver 127.0.0.11 valid=30s ipv6=off;
set $upstream_pass http://:/;
proxy_pass $upstream_pass;
Describe alternatives you've considered
Easier access to proxy_host configuration when nginx-proxy-manager is off to remove non-working configuration
Additional context
error when nginx-proxy-manager is restarted :
host not found in upstream "bar:3000" in /data/nginx/proxy_host/1.conf
@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 you can test my fix, that would be really helpful.
@github-actions[bot] commented on GitHub (Feb 25, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@Scemist commented on GitHub (May 3, 2024):
Same problem here, it doesn't make sense to fail the Nginx server for one proxy pass, since you can use it as an proxy for multiples addresses. So if some of websites fails, all the others will too.
@Lavshyak commented on GitHub (Jun 8, 2024):
now nginx don't crashes when someserver:80 is down
Upd: but then nginx cut off the rest of the request uri. http://host/foo/bar becomes just http://someserver:80/. How to fix this?
@tyyrok commented on GitHub (Jul 15, 2024):
Hi. Look at this article:
https://dev.to/danielkun/nginx-everything-about-proxypass-2ona#let-nginx-start-even-when-not-all-upstream-hosts-are-available
@Lavshyak commented on GitHub (Aug 7, 2024):
nginx:mainline-alpine3.18-perl works well for me. I don't notice any failures
@ZandercraftGames commented on GitHub (Jan 7, 2025):
Also having the same issue here. Quite frustrating to get working.
@abstract-entity commented on GitHub (Mar 10, 2025):
got the same with latest nginx docker image
@Legendary4226 commented on GitHub (Aug 14, 2025):
In the same annoying situation, like I build a container for Docker and Podman. Depending on the network subnet and the container engine, I can't guess the resolver IP.
I'm just blocked because there is no options. Should be good to define the resolver directive with a default value (for example "host") that preserve the default behavior (auto resolve with /etc/resolv.conf) and also activate the other wanted behavior that is the main subject of this issue.
I will just switch from NGINX to anything else more flexible, like who likes to have nothing working because of a little bit of dust in some config file ?
@yn-alex commented on GitHub (Aug 29, 2025):
Man.. this is a super annoying and totally unnecessary “feature”.
If the backend is dead just let it be dead, and use that http 500 code to tell us.
What is the difference between not starting nginx because the backend is dead and killing it if the backend dies 1 second after nginx goes up?
You would not kill the proxy if the pleb backend is acting up, and nobody does it. But you don’t allow it to start because of the same issue. There is simply no practical and technical reason to not allow the process to start because of this.
We run nginx with over 50 custom locations across multiple services. And it simply won’t start if one is dead or missconfigured (like typing the wrong port there).
@Daredevll commented on GitHub (Oct 27, 2025):
Any info on that? I'm also curious as to why this happens and honestly seems like a bug to me. We've got multiple independent containerized services running and removing one without disabling the proxy pass in NPM renders NPM inoperable, in practice taking down our whole suite of services..
@tjunussov commented on GitHub (Nov 19, 2025):
Stupid feature, sometimes one small host could be down,
and whole server if rebooted, nginx-proxy-manager wont start,
of course of nginx host check feature, maybe we could do something smart ? if nginx failing to start, we could start at least itself in safe mode ? so user could disable failty host