deer-flow/scripts/nginx.sh
Hyeonsang Cho f8b419ab38
fix(scripts): bind local make dev and make start to loopback (#6587)
* fix(scripts): bind local make dev and make start to loopback

serve.sh and backend/Makefile started the Gateway with --host 0.0.0.0,
nginx.local.conf listened on every interface, and Next.js kept its
all-interfaces default outside Windows, so a local stack on a LAN or VPN
exposed ports 2026, 8001 and 3000, including /setup before the first
admin existed. The Docker stack and the README already document a
loopback-only default.

Bind the Gateway and frontend to 127.0.0.1 and keep nginx on loopback
unless BIND_HOST is set, the variable the Docker stack already honors.
nginx-local-conf.sh renders a copy listening on BIND_HOST, and serve.sh
resolves it before stopping anything so an invalid value cannot tear
down a running stack.

* docs(changelog): reference #6587

* docs(changelog): separate the loopback entry from the next bullet

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-10-10 15:47:30 +08:00

20 lines
636 B
Bash
Executable File

#!/usr/bin/env bash
#
# nginx.sh — Start nginx alone in the foreground with the local dev config.
#
# Mirrors how scripts/serve.sh launches nginx (same prefix, config, and
# pre-created directories) — keep the two in sync.
#
# Usage: make nginx (or ./scripts/nginx.sh from anywhere)
set -e
REPO_ROOT="$(builtin cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null 2>&1 && pwd -P)"
cd "$REPO_ROOT"
mkdir -p logs
mkdir -p temp/client_body_temp temp/proxy_temp temp/fastcgi_temp temp/uwsgi_temp temp/scgi_temp
NGINX_CONF="$(bash "$REPO_ROOT/scripts/nginx-local-conf.sh")"
exec nginx -g 'daemon off;' -c "$NGINX_CONF" -p "$REPO_ROOT"