feat: expose boss via nginx base path

This commit is contained in:
Codex
2026-03-23 13:31:23 +08:00
parent bc04c439fb
commit 5c3636fe6a
9 changed files with 149 additions and 44 deletions

View File

@@ -5,6 +5,12 @@ port="${PORT:-43210}"
data_dir="${BOSS_DATA_DIR:-.boss-data}"
pid_file="${BOSS_PID_FILE:-$data_dir/server.pid}"
log_file="${BOSS_LOG_FILE:-$data_dir/server.log}"
base_path="${BOSS_BASE_PATH:-}"
if [[ -n "$base_path" && "$base_path" != /* ]]; then
base_path="/$base_path"
fi
base_path="${base_path%/}"
health_url="http://127.0.0.1:${port}${base_path}/api/health"
if [[ -f "$pid_file" ]]; then
pid="$(cat "$pid_file")"
@@ -18,7 +24,7 @@ else
fi
echo "---"
curl -fsS "http://127.0.0.1:${port}/api/health" || true
curl -fsS "$health_url" || true
echo
echo "---"
tail -n 40 "$log_file" 2>/dev/null || true