Spaces:
Paused
Paused
fix: use nginx -c /scripts/nginx.conf to bypass /etc/nginx restore
Browse files
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 |
-
#
|
| 117 |
-
|
|
|
|
| 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
|