Set up reverse proxy using template

I am trying to set up a reverse proxy using the template here: https://railway.app/template/7uDSyj I have configured the FRONTEND_HOST and BACKEND_HOST to be (for example) ${{app-ui.RAILWAY_PRIVATE_DOMAIN}}:3000 and ${{app-be.RAILWAY_PRIVATE_DOMAIN}}:3000. Both services are running on port 3000. I am getting the error in the picture when trying to start the reverse proxy but I am not sure why. Thank you.
No description
25 Replies
Percy
Percy10mo ago
Project ID: 8901e750-2bdf-424d-ae30-eeab10952fcc
Percy
Percy10mo ago
Project ID: 8901e750-2bdf-424d-ae30-eeab10952fcc
jeffrey1031
jeffrey1031OP10mo ago
8901e750-2bdf-424d-ae30-eeab10952fcc
Brody
Brody10mo ago
can you send a screenshot of the railway project that has the proxy service in it?
jeffrey1031
jeffrey1031OP10mo ago
is this what you want?
No description
jeffrey1031
jeffrey1031OP10mo ago
my env variables for the caddy reverse proxy: BACKEND_HOST: flight-info-agg-be.railway.internal:3000 FRONTEND_HOST: flight-info-agg-ui.railway.internal:3000
Brody
Brody10mo ago
are those the correct private domains according to the service settings?
jeffrey1031
jeffrey1031OP10mo ago
i found out that the reverse proxy is never touched after deployment, as in there is no request to it the error i showed was from the build which was successful
Brody
Brody10mo ago
?
jeffrey1031
jeffrey1031OP10mo ago
yes they are
jeffrey1031
jeffrey1031OP10mo ago
no i dont
Brody
Brody10mo ago
go ahead and add it to the proxy service
jeffrey1031
jeffrey1031OP10mo ago
I just added it. It is still not working.
Brody
Brody10mo ago
show me please
jeffrey1031
jeffrey1031OP10mo ago
No description
Brody
Brody10mo ago
show me the new errors please
jeffrey1031
jeffrey1031OP10mo ago
the deployment log is the same as my first post. the problem seems to be that no traffic is touching the reverse proxy
Brody
Brody10mo ago
maybe you arent understanding the purpose of the reverse proxy?
jeffrey1031
jeffrey1031OP10mo ago
Yes I think maybe i misunderstood something. If my ui can be accessed on https://abc.railway.app and i have this reverse proxy set up, I think i should be able to health check my backend by accessing https://abc.railway.app/api/health ? Am i correct in saying that?
Brody
Brody10mo ago
depends, whats the domain you have on the proxy service
jeffrey1031
jeffrey1031OP10mo ago
852 Flight Deals
Hong Kong's flight-related discounts and deals
Brody
Brody10mo ago
you access your frontend and backend throught this domain
jeffrey1031
jeffrey1031OP10mo ago
oh thats it. i thought i could access the frontend and backend using the frontend's domain. i guess that solves the issue. let me check. it works! thank you! one more question: should i call my backend from frontend using the proxy's domain?
Brody
Brody10mo ago
the purpose of the proxy was so that you can call the backend by just specifying a path instead of a full domain
Want results from more Discord servers?
Add your server