Internal Domain not working When communicating from NextJS backend to other service
Hi I have a NEXTJS UI, and another backend service (we'll call this "Scheduling API") that my NextJS backend calls
When I had my NextJS Backend talk to the Scheduling API by hosting Scheduling API on a public domain, the communication worked fine.
When I switch the scheduling API to be Private Networking only, the communication does not work.
My NextJS backend calls the Scheduling API to fetch some data BEFORE the HTML is sent over to the user's browser, so it is not actually the user's browser that is trying to call the Scheduling API
Here is a screenshot of my Scheduling API networking configuration: (image 1)
Here is a screenshot of the logs of a successful Scheduling API deploy showing that the scheduling API is running on prod on port 8080: (image 2)
For debugging purposes: I tried calling the Scheduling API with 15 different permutations of urls, and none of them worked (images 3 and 4)
What am I doing wrong? I'd like to not have to publicly expose my Scheduling API to the public internet.
5 Replies
Project ID:
1339a864-7c51-476c-a203-f5018a535a85
1339a864-7c51-476c-a203-f5018a535a85/logs
I wonder if image 2 has my answer. I wonder if rather than having my Scheduling API bootup logs print "Server is running at http://0.0.0.0:8080", it should be printing "Server is running at https://scheduling.railway.internal:8080"
I wish there was someway to ssh into the container running my NextJS app and try different curl requests to see how to actually access my Scheduling API backend, but I get that's not really the mental model of Railway
I think I'm just going to host my Scheduling API on a public domain and use a secret as auth, rather than try to get this internal networking working
hey, the service you want to communicate with needs to listen on
::
(ipv6) since the private network is ipv6 onlyGot it. TY will try that tomorrow
sounds good!