Skip to content
← Back to activity

Solution skill

fix(docker): nginx caches wrong upstream IP after restart when host DNS search domains resolve service names externally

Version 2Sign in to save

Complete solution

Dify: fix(docker): nginx caches wrong upstream IP after restart when host DNS search domains resolve service names externally. The verified fix is Fix: Contributor kanson1996 diagnosed: nginx resolved upstream service names to IPs once at startup and cached them, so after a container restart the IP was stale whenever host DNS search domains resolved the service names externally. Use this when you hit the symptoms above in dify; not for unrelated dify errors or general setup questions.

TL;DR

Fix: Contributor kanson1996 diagnosed: nginx resolved upstream service names to IPs once at startup and cached them, so after a container restart the IP was stale whenever host DNS search domains resolved the service names externally. Fixed by merged PR #39155 ('use dynamic DNS resolution for all nginx upstreams') on 2026-08-11 - upgrade to a build containing that fix.

The error

Issue langgenius/dify#39154 (closed, 60 comments): ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文

Fix

  1. Contributor kanson1996 diagnosed: nginx resolved upstream service names to IPs once at startup and cached them, so after a container restart the IP was stale whenever host DNS search domains resolved the service names externally.
  2. Fixed by merged PR #39155 ('use dynamic DNS resolution for all nginx upstreams') on 2026-08-11 - upgrade to a build containing that fix.

Success check: the symptom above is gone and the original operation completes.

When to use

  • You hit this exact symptom in dify.
  • You want the verified fix without digging through the thread.

When not to use

  • A different error in dify, even a similar-looking one.
  • General dify setup or credential questions.

Compatibility

  • Dify (langgenius/dify)

Variant phrasings

  • How to fix "fix(docker): nginx caches wrong upstream IP after restart when host DNS search domains resolve service names externally" in dify
  • dify: fix(docker): nginx caches wrong upstream IP after restart when host DNS search domains resolve service names externally

Source

  • https://github.com/langgenius/dify/issues/39154

Evidence

In gh:langgenius/dify#39154 (https://github.com/langgenius/dify/issues/39154), someone reported: Issue langgenius/dify#39154 (closed, 60 comments): ### Self Checks - [x] I have read the Contributing Guide and Language Policy. - [x] This is only for bug report, if you would like to ask a question, please head to Discussions. - [x] I have searched for existing issues search for existing issues, including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文 The verified resolution from the thread: Contributor kanson1996 diagnosed: nginx resolved upstream service names to IPs once at startup and cached them, so after a container restart the IP was stale whenever host DNS search domains resolved the service names externally. Fixed by merged PR #39155 ('use dynamic DNS resolution for all nginx upstreams') on 2026-08-11 - upgrade to a build containing that fix.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_aq7G2QLRiNXE_vcRknXYMw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">fix(docker): nginx caches wrong upstream IP after restart when host DNS search domains resolve service names externally <span>— Vectle</span></a>

fix(docker): nginx caches wrong upstream IP after restart when host DNS search domains resolve service names externally | Vectle