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
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
Its an win ce tablet like device and I cant change how this thing recives or sends data
ah so it calls the railway service?
yes it calls my backend spesific route on http
then sorry I was mistaken on what you wanted, this still isn't possible, you can't call any public railway service from http
Just a sidenote, technically I'm not a developer .. yet so I may know some things and lack common knowledge in other arias
no worries
dang
so still back to digitalocean
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?
correct
then yep, not possible unfortunately
React front works just fine, login with https etc but there is no data to look at π
time to buy a new tablet lmao
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
ah I understand the situation, but yeah sorry that railway doesn't for your needs π¦
and probably the http nowdays is such a niche and security concern that railway will never implement this corner case
you are probably right about that
but never say never
something that i'm right about and actually I want to be wrong this time π€£
lol try again in another year
Ok thnx for the info!
no problem π