R
Railwayβ€’16mo ago
bjorn

nginx setup for http and https ports for different traffic

Hi, So I have this setup that currently my react fe is in Railway but back (nodejs) is in Digitalocean. I would like to move the back also to Railway but ther is this thing that one spesific route uses http connections and (last year or so when I tried) Railway did not allow it. So I found this tutorial https://hackmamba.io/blog/2022/09/practical-steps-to-deploy-a-node-js-app-with-nginx-and-ssl/ (or may have been similar thing from digitalocean, can't really remember). I have set up ngnix in digitalocean and this is working currently OK. But like I said would like to move over to Railway. Would similar nginx setup work? Is there a tutorial that is more Railway spesific? Currently my backend is deployed on Railway and I also included this nginx template https://railway.app/template/o3MbZe and changed the defulat conf to my current working one but of course this does not work. And as I don't know nginx well enough I don't know what to change there. Or hat to try next. So what I'm asking is any advice forward? My ngnix conf attached.
Practical Steps to Deploy a Node.js App with NGINX and SSL
Learn how to auto-deploy a Node.js application with NGINX by creating a Droplet in DigitalOcean for the application, setting up NGINX as a reverse proxy server, and setting up SSL for security.
21 Replies
Brody
Brodyβ€’16mo ago
railway still doesn't allow you to access the service directly over http, but with internal networking you could totally achieve this with a proxy, but first, I don't quite understand why that that route will only accept traffic over http
bjorn
bjornβ€’16mo ago
Its an win ce tablet like device and I cant change how this thing recives or sends data
Brody
Brodyβ€’16mo ago
ah so it calls the railway service?
bjorn
bjornβ€’16mo ago
yes it calls my backend spesific route on http
Brody
Brodyβ€’16mo ago
then sorry I was mistaken on what you wanted, this still isn't possible, you can't call any public railway service from http
bjorn
bjornβ€’16mo ago
Just a sidenote, technically I'm not a developer .. yet so I may know some things and lack common knowledge in other arias
Brody
Brodyβ€’16mo ago
no worries
bjorn
bjornβ€’16mo ago
dang so still back to digitalocean
Brody
Brodyβ€’16mo ago
but just to be clear, your backend has no problem accepting proxied https requests originating from something like postman? it's just your windows ce tablet that can't call an https service?
bjorn
bjornβ€’16mo ago
correct
Brody
Brodyβ€’16mo ago
then yep, not possible unfortunately
bjorn
bjornβ€’16mo ago
React front works just fine, login with https etc but there is no data to look at πŸ˜„
Brody
Brodyβ€’16mo ago
time to buy a new tablet lmao
bjorn
bjornβ€’16mo ago
its a 4K tablet taht does scaling so the software on top is worth more then the device itself the hw is maybe 20 at best But thnx, at least I know that there is no point doing some experiments to get this nginx working
Brody
Brodyβ€’16mo ago
ah I understand the situation, but yeah sorry that railway doesn't for your needs 😦
bjorn
bjornβ€’16mo ago
and probably the http nowdays is such a niche and security concern that railway will never implement this corner case
Brody
Brodyβ€’16mo ago
you are probably right about that but never say never
bjorn
bjornβ€’16mo ago
something that i'm right about and actually I want to be wrong this time 🀣
Brody
Brodyβ€’16mo ago
lol try again in another year
bjorn
bjornβ€’16mo ago
Ok thnx for the info!
Brody
Brodyβ€’16mo ago
no problem πŸ™‚
Want results from more Discord servers?
Add your server