2026-07-10 12:54:45 +00:00
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
# 安裝/更新 nginx conf(需要 sudo)
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
# shellcheck source=_common.sh
|
|
|
|
|
|
source "$(cd "$(dirname "$0")" && pwd)/_common.sh"
|
|
|
|
|
|
|
|
|
|
|
|
SRC="$DEPLOY_DIR/nginx/haixun-dev.conf"
|
|
|
|
|
|
DST="/etc/nginx/conf.d/haixun.conf"
|
|
|
|
|
|
|
|
|
|
|
|
[[ -f "$SRC" ]] || die "missing $SRC"
|
|
|
|
|
|
|
|
|
|
|
|
log "install $SRC → $DST"
|
|
|
|
|
|
sudo cp "$SRC" "$DST"
|
|
|
|
|
|
sudo nginx -t
|
|
|
|
|
|
sudo systemctl reload nginx
|
|
|
|
|
|
log "nginx reloaded"
|
2026-07-23 05:56:42 +00:00
|
|
|
|
log "驗:curl -sI -H 'Host: threads-tool.30cm.net' http://127.0.0.1/api/v1/ping"
|