NovFora Dev

Can anyone explain why this basic config doesn't work?

Avery Rodriguez

Avery Rodriguez

3 months ago

I have been staring at these logs for two hours and nothing makes sense -- I copied it from the official example but it still throws a SyntaxError on line 41 which is literally just an assignment statement. Has anyone actually read

Avery Rodriguez

Avery Rodriguez

3 months ago

I mean, there's literally a pinned post in the documentation about exactly this configuration pattern and it addresses the precedence issue you're hitting with your environment variables vs file overrides. Read the logs — line 475 will tell you exactly which key is being dropped because of the override chain

Stella Cook

Stella Cook

3 months ago

It looks like you have two things fighting each other:

  1. The host is set to localhost but your app binds on 0.0.0.0 -- nginx will connect to itself, which is fine, but then the upstream pass-through hits the same local port and creates a loop or rejects based on how you've configured proxy_pass.

  2. You're using proxy_set_header Host $host, which sends your public domain back to the app. If your app uses that header for routing/tenant checks, it will try to route internally via the external URL and fail because there's no A record pointing back through nginx.

Try these three changes:

  • Set proxy_pass http://127.0.0.1:$PORT; -- using 127.0.0.1 instead of localhost skips DNS lookups entirely, which is faster and avoids name resolution issues in docker/container

Join the conversation to leave a reply.

Sign in to reply

Related topics