Unable to call api of backend-service from frontend-service via internal railway network

ahsen2928
HOBBY

8 days ago

I have settled up 3 services.
1. asms-api-internal (Java Backend Git repo based)
2. asms-frontend-internal (Angular Express JS Frontend Git repo based)
3. mysql (Custom MySQL 5.7 version)

My backend is connecting fine with MySQL via internal network and variables. But in my frontend, I am using service name of backend instead of http://localhost:8080 The service name is like https://asms-api-internal.railway.internal:8080
Also settled up PORT variable with value 8080 in both frontend and backend services. But whenever i try to call any api then it throws 502 error.

What should be the valid value i can give to access the backend api via internal calls (without cost)?

I tried to use the forward proxy with frontend server.js code but that is also not working. Snapshot of that code is also attached.

Attachments

$10 Bounty

3 Replies

Railway
BOT

8 days ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


0x1618
FREE

8 days ago

You are probably listening on IPv4 instead of IPv6 (https://docs.railway.com/reference/private-networking#caveats)

If you listen on 0.0.0.0:8080, you need to use [::]:8080 instead. (on asms-api-internal server)


fra
HOBBYTop 5% Contributor

8 days ago

I think you should use http instead of https