How to use private networking?
I have set up private networking for our backend service, which gives me backend.railway.internal as internal name. Now how would one use this name in for instance axios in our frontend (which is also hosted in the same environment on railway). Since it does not have a https:// prefix / is a public domain, I feel like this will never work with axios. Am I missing something here?
Solution:Jump to solution
client side rendered sites would need to call a publicly accessible backend domain
16 Replies
Project ID:
65dddace-3981-48b0-85e2-50588ba68208
65dddace-3981-48b0-85e2-50588ba68208
what kind of frontend app is this?
nextjs
and are you hoping to make these requests to the backend from the backend of your next app?
no, we have a frontend in NextJS and a backend in NestJS, both deployed on railway
so using the public url from the backend works, but private networking is where im confused atm
how to set that up in the frontend
if a clients browser will be making this request you would need to use the public domain.
if you are doing server side rendering then you can call the private domain
ahaa
wouldn't be much a private domain if a clients browser could call the private domain
so then the requests would take place in the api folders of nextjs? with fetch
is this a next frontend and backend in a single service?
no seperated
is the frontend next app client side rendered?
for now yes, but we could pivot to SSR if that would solve this issue
no issue, just a little confusion
Solution
client side rendered sites would need to call a publicly accessible backend domain