Skip to content

Fix nginx routing: 127.0.0.1 instead of host.docker.internal - #25

Open
gi-os wants to merge 1 commit into
mainfrom
claude/fix-nginx-host-routing
Open

Fix nginx routing: 127.0.0.1 instead of host.docker.internal#25
gi-os wants to merge 1 commit into
mainfrom
claude/fix-nginx-host-routing

Conversation

@gi-os

@gi-os gi-os commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Problem

nginx.js was generating shop location blocks using host.docker.internal as the upstream host. This hostname only resolves inside Docker containers — it is NOT resolvable by the host nginx process, causing nginx to fail its config test and refuse to reload, making new shops unreachable.

Also fixed: routing pattern now uses location /slug/ (trailing slash, no rewrite rules) matching the standard pattern used by demox, demoxi, edition, michael-kors. The old rewrite approach stripped the basePath prefix before passing to Next.js, breaking asset loading.

Fix

  • proxy_pass http://127.0.0.1:${port} — resolves from host
  • location /${slug}/ — trailing slash, no rewrite, passes full path to Next.js
  • reloadNginx() now calls nginx -t && systemctl reload nginx directly instead of docker exec nginx-proxy

Affected shops

demo12 was the first shop created with the broken generator. Fixed manually on server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants