tao-shen Claude Opus 4.6 commited on
Commit
7152d8b
Β·
1 Parent(s): bdc0fe0

fix: use nginx -c /scripts/nginx.conf to bypass /etc/nginx restore

Browse files
Files changed (1) hide show
  1. ubuntu-server/start-server.sh +4 -3
ubuntu-server/start-server.sh CHANGED
@@ -113,10 +113,11 @@ log "[ubuntu] Stream SSE: curl -N https://<space>.hf.space/runlog/stream"
113
  done) &
114
 
115
  # ── Start nginx LAST β†’ opens port 7860 β†’ HF transitions to RUNNING ──
116
- # Restore Docker image's nginx config (dataset restore may overwrite /etc/nginx)
117
- cp /scripts/nginx.conf /etc/nginx/nginx.conf 2>/dev/null || true
 
118
  log "[ubuntu] Starting nginx on 0.0.0.0:7860 (HF will mark RUNNING) ..."
119
- nginx -g 'daemon off;' &
120
  NGINX_PID=$!
121
  log "[ubuntu] nginx started PID=${NGINX_PID}"
122
  trap "kill $NGINX_PID 2>/dev/null; wait $NGINX_PID 2>/dev/null; exit" SIGTERM SIGINT SIGQUIT
 
113
  done) &
114
 
115
  # ── Start nginx LAST β†’ opens port 7860 β†’ HF transitions to RUNNING ──
116
+ # Use /scripts/nginx.conf directly (dataset restore may overwrite /etc/nginx/)
117
+ log "[ubuntu] nginx config: /scripts/nginx.conf"
118
+ log "[ubuntu] $(head -1 /scripts/nginx.conf 2>&1 || echo 'MISSING')"
119
  log "[ubuntu] Starting nginx on 0.0.0.0:7860 (HF will mark RUNNING) ..."
120
+ nginx -c /scripts/nginx.conf -g 'daemon off;' &
121
  NGINX_PID=$!
122
  log "[ubuntu] nginx started PID=${NGINX_PID}"
123
  trap "kill $NGINX_PID 2>/dev/null; wait $NGINX_PID 2>/dev/null; exit" SIGTERM SIGINT SIGQUIT