fix: use dedicated internal port to avoid collision with PORT env

If a platform injects PORT=3000 (e.g. Railway), nginx and Next.js
would both try to bind port 3000. Use a dedicated internal port (7901)
for the nginx→Next.js proxy to prevent this.
This commit is contained in:
Thomas Camlong committed 2026-06-08 16:53:43 +02:00
1 parent e004afa806
commit e85c407453
2 files changed
+4 -9

No files matched your search

+1 -3
View File
@@ -7,7 +7,6 @@ http {
listen ${PORT};
listen [::]:${PORT};
# Route websockets traffic to port 3001
location /websockets {
proxy_pass http://${HOSTNAME}:3001;
proxy_http_version 1.1;
@@ -16,9 +15,8 @@ http {
proxy_set_header Host $http_host;
}
# Route all other traffic to port 3000
location / {
proxy_pass http://${HOSTNAME}:3000;
proxy_pass http://${HOSTNAME}:${INTERNAL_NEXTJS_PORT};
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;