mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 09:58:22 +08:00
fix: use Railway PORT env var for nginx
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# Frontend static files + API proxy to backend
|
||||
|
||||
server {
|
||||
listen 8080;
|
||||
listen ${PORT};
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
@@ -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;"
|
||||
@@ -16,7 +16,7 @@ stderr_logfile_maxbytes=0
|
||||
environment=API_SERVER_PORT="8081",DB_PATH="/app/data/data.db"
|
||||
|
||||
[program:nginx]
|
||||
command=nginx -g "daemon off;"
|
||||
command=/app/start-nginx.sh
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
|
||||
Reference in New Issue
Block a user