Skip to content

fix(docker): bind Node to IPv4 loopback for NGINX upstream - #314

Open
syf2211 wants to merge 1 commit into
firecrawl:mainfrom
syf2211:fix/docker-nginx-ipv4-loopback
Open

fix(docker): bind Node to IPv4 loopback for NGINX upstream#314
syf2211 wants to merge 1 commit into
firecrawl:mainfrom
syf2211:fix/docker-nginx-ipv4-loopback

Conversation

@syf2211

@syf2211 syf2211 commented Jul 14, 2026

Copy link
Copy Markdown

Summary

Set HOST=127.0.0.1 in the bundled Docker service image so the Node MCP server listens on the same IPv4 loopback address that NGINX proxies to.

Motivation

Fixes #251. On IPv6-enabled images, the default HOST=localhost can resolve to ::1, while docker/nginx.conf upstream targets 127.0.0.1:3000. That mismatch makes the provided container unreachable until users manually set HOST=127.0.0.1.

Changes

  • docker/entrypoint.sh: export HOST=${HOST:-127.0.0.1} before starting the Node process (runtime override still works)
  • Dockerfile.service: document the default with ENV HOST=127.0.0.1

Tests

  • pnpm test — 9/9 passed
  • composer-2.5 review: APPROVE

Notes

  • Scoped to the Docker service image only; non-Docker HOST behavior is unchanged.
  • CLOUD_SERVICE=true deployments still bind 0.0.0.0 as before.

Set HOST=127.0.0.1 in the service image entrypoint and Dockerfile so the
MCP server listens on the same address NGINX proxies to. Without this,
default HOST=localhost can resolve to ::1 on IPv6-enabled images while
nginx.conf upstream targets 127.0.0.1, breaking the bundled container.

Fixes firecrawl#251
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.

Provided docker container cannot be connected to, because MCP server only listens to ipv6 ::1 while NGINX proxies traffic to ipv4 loopback

1 participant