feat: Dynamic upstream DNS resolution for proxy hosts#5487
Open
hactazia wants to merge 2 commits intoNginxProxyManager:developfrom
Open
feat: Dynamic upstream DNS resolution for proxy hosts#5487hactazia wants to merge 2 commits intoNginxProxyManager:developfrom
hactazia wants to merge 2 commits intoNginxProxyManager:developfrom
Conversation
When enabled, nginx resolves the upstream hostname at request time using Docker's internal DNS resolver (127.0.0.11) instead of only at startup. This prevents nginx from failing when an upstream container is not yet running or restarts with a new IP.
|
CI Error: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a "Dynamic Upstream Resolve" toggle to proxy hosts. When enabled,
nginx uses a
resolverdirective and a$upstream_hostvariable sothat the upstream hostname is resolved at request time via Docker's
internal DNS (127.0.0.11), rather than once at nginx startup.
This is useful when the upstream container may not be running when
nginx starts, or when its IP can change (e.g. after a restart).
Changes
dynamic_upstream_resolvetinyint column toproxy_hostboolFieldsresolver 127.0.0.11 valid=10sin theserver block and
set $upstream_hostin custom locations when enableddynamic_upstream_resolveto the locationrendering context (was missing, causing the variable to be ignored)
host.flags.dynamic-upstream-resolvekey to all localesNotes
This feature is Docker-specific. The resolver
127.0.0.11is Docker'sembedded DNS and is only available inside a Docker network bridge.