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:
client side rendered sites would need to call a publicly accessible backend domain
Jump to solution
16 Replies
Percy
Percy13mo ago
Project ID: 65dddace-3981-48b0-85e2-50588ba68208
Boris Winter
Boris Winter13mo ago
65dddace-3981-48b0-85e2-50588ba68208
Brody
Brody13mo ago
what kind of frontend app is this?
Boris Winter
Boris Winter13mo ago
nextjs
Brody
Brody13mo ago
and are you hoping to make these requests to the backend from the backend of your next app?
Boris Winter
Boris Winter13mo ago
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
Brody
Brody13mo ago
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
Boris Winter
Boris Winter13mo ago
ahaa
Brody
Brody13mo ago
wouldn't be much a private domain if a clients browser could call the private domain
Boris Winter
Boris Winter13mo ago
so then the requests would take place in the api folders of nextjs? with fetch
Brody
Brody13mo ago
is this a next frontend and backend in a single service?
Boris Winter
Boris Winter13mo ago
no seperated
No description
Brody
Brody13mo ago
is the frontend next app client side rendered?
Boris Winter
Boris Winter13mo ago
for now yes, but we could pivot to SSR if that would solve this issue
Brody
Brody13mo ago
no issue, just a little confusion
Solution
Brody
Brody13mo ago
client side rendered sites would need to call a publicly accessible backend domain
Want results from more Discord servers?
Add your server