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.
Shell into the machine doing the proxying and see if you can curl a response to the other machine, using the target address you’ve configured in your proxy. Also, don’t be afraid of using real internal addresses in this forum - they are private to your org’s network, and seeing them may help readers understand what you’re doing wrong.
Okay so yeah the WS server is running and can be accessed from the main app’s machine, cant tell why it’s not connecting me when i do wss://mainapp.com/ws maybe Nginx
Just reading the configs in this post, so let me know if I’m missing something.
The biggest issue here is that your Fly config has http_service.internal_port set to port 3000, which is the port for your app, not the port for nginx. Since you have nginx listening on port 80, this is what you’ll want to set your internal_port to as well so that traffic gets delivered.
Keep the :443 out of your upstream as well. The .internal addresses don’t go through the Fly proxy at all, so there’s nothing between to handle TLS for you.
I can’t guarantee there aren’t other issues in there, but changing the port at least will get your traffic hitting port 80 where you can debug further