feat: expose boss via nginx base path
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user