I’m trying to proxy my ws app to run on the 1st app as /ws so firstapp.com/ws. Both are on Fly.io, so I’ve tried using Nginx and it just doesn’t respond, the main app does but /ws doesn’t, it just returns 404.
I am not sure if I am missing something, Nginx is clearly running too.
primary_region = 'otp'
[build]
release_command = "npx prisma db push --force-reset"
[deploy]
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[vm]]
memory = '2gb'
cpu_kind = 'shared'
cpus = 1
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream ws_backend{
server ws.internal:443;
}
server {
listen 80;
location /ws/ {
proxy_pass http://ws_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
}
I am really not sure what to do here, there’s not much info or even posts on this forum about people doing this.