Private Networking Unavailable, Caddy Reverse Proxy

alphalink
PRO

a year ago

Hey Team,

I am came across this repo (https://github.com/railwayapp-templates/caddy-reverse-proxy) which was super helpful to setup reverse proxy.

Do I understand correct that if the services that reverse proxy routes the traffic to is undergoing a build process, the respective service would be unavailable for the time the build is on going? Asking to confirm if I understood correctly what I read here https://docs.railway.app/guides/private-networking. Is there any workaround to avoid downtime?

12 Replies

a year ago

When I developed that template I tested it by constantly refreshing the page on a loop and ran a build for the frontend, I did not experience any downtime.


alphalink
PRO

a year ago

Could it be that the page was cached on the browser. Should I provide you my project ID so that you can help me debug because I am facing this issue where every time my project builds the reverse proxy can't reach the internal networking URL?


a year ago

A project ID would not help me as I do not work for Railway.

Are you sure you are using the internal URLs? I just ran another test and can not replicate this issue.


alphalink
PRO

a year ago

Ahh I see. First of all thank you very much for your help :)
Yes I am 100% certain I am using internal URLs as I see it ends with .railway.internal


a year ago

Are you able to provide an example repo for the proxy and the frontend app, along with all the needed configurations for the Railwat side of things?

I am still unable to reproduce any issues when accessing the proxy's URL while running a build of the frontend service.


Do I understand correct that if the services that reverse proxy routes the traffic to is undergoing a build process, the respective service would be unavailable for the time the build is on going?

This is incorrect. The docs page you linked explains that private networking is not available during builds, meaning you're unable to access your private network in the build process (e.g. dialing a service directly in the build). It does not mean that your services will be offline when it's building.

If you have an active deployment, your traffic gets routed to that deployment, and traffic only gets switched over to a new deploy after it goes live. As long as you have an active deploy capable of servicing the traffic, you'll have no downtime.


alphalink
PRO

a year ago

@rc can you help me identify then what's the issue if I provide my projectID?


Project IDs are always appreciated :)

Have you set up healthchecks? https://docs.railway.app/reference/healthchecks

This will ensure your new deploy is ready to go before we cut traffic over.


alphalink
PRO

a year ago

Yes, I do have health check in place. My project is 8ed940ec-4de1-4133-9e38-60f06fe1f691


Do you have health checks on the Caddy proxy?


alphalink
PRO

a year ago

No I don't have it on caddy. Could that be the issue? I mean I hardly deploy caddy. I understand that I should have health check there but when I deploy service that caddy routes to, and caddy is not undergoing a build, the other service should still be reachable. right?


alphalink
PRO

a year ago

Adding health check to caddy proxy did the trick. Thank you @rc 🙏