thread-master/deploy/scripts/install-nginx.sh

18 lines
483 B
Bash
Raw Normal View History

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"
log "驗curl -sI -H 'Host: threads-tool-dev.30cm.net' http://127.0.0.1/api/v1/ping"