nginx: host not found in upstream Nginx / Apache Origin: Edge & web server OSI layer 7 · Application Last updated 5 Nov 2026

Nginx: nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/default.conf:5

Nginx couldn't resolve the hostname in an upstream/proxy_pass at startup.

Exact message you may see nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/default.conf:5[emerg] host not found in upstreamhost not found in upstream "backend:3000"nginx: [emerg] host not found in resolvercould not be resolved (3: Host not found) nginx
Seen on: Nginx Docker

Meaning

Nginx resolves upstream names when it loads the config. In Docker Compose the service must exist and be on the same network and started; if the backend isn't up yet nginx exits. Use resolver 127.0.0.11; with a variable in proxy_pass for lazy resolution, or depends_on + restart policy.

Common causes

  • Backend container not started/not on the same network
  • Typo in the host name
  • DNS not available at nginx startup
  • Static resolution at load time
  • Kubernetes service not created

⚡ Quick fix

  1. Start the backend first (depends_on) and verify the service name
  2. Use lazy resolution: resolver 127.0.0.11 valid=10s; set $up http://app:3000; proxy_pass $up;
  3. Check docker network inspect

Detailed fix by platform

Docker

  1. docker compose exec nginx getent hosts app

How to diagnose

  1. Name — Spelled right?
  2. Network — Same?
  3. Resolution — At startup?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):

1000 — Cloudflare Error 1000: DNS points to prohibited IP (Cloudflare)10001001 — Cloudflare Error 1001: DNS resolution error (Cloudflare)10011002 — Cloudflare Error 1002: DNS points to Prohibited IP / Restricted (Cloudflare)10021003 — Cloudflare Error 1003: Direct IP access not allowed (Cloudflare)10031004 — Cloudflare Error 1004: Host Not Configured to Serve Web Traffic (Cloudflare)10041014 — Cloudflare Error 1014: CNAME Cross-User Banned (Cloudflare)10141016 — Cloudflare Error 1016: Origin DNS error (Cloudflare)10161018 — Cloudflare Error 1018: Could not find host (Cloudflare)1018nginx: ho…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.