fix: use Railway PORT env var for nginx

This commit is contained in:
tinkle-community
2026-01-06 18:07:11 +08:00
parent 7db37ade1c
commit 29cd79c626
4 changed files with 22 additions and 5 deletions

13
railway/start-nginx.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
# Nginx startup wrapper - substitutes PORT environment variable
# Default PORT to 8080 if not set
export PORT=${PORT:-8080}
echo "🌐 Starting nginx on port $PORT..."
# Generate nginx config from template
envsubst '${PORT}' < /etc/nginx/nginx.conf.template > /etc/nginx/http.d/default.conf
# Start nginx
exec nginx -g "daemon off;"