Private networking, Caddy reverse proxy.

p4ulcristianHOBBY

10 months ago

Hello Railway!

I have a container running this code: https://github.com/p4ulcristian/wizard-proxy

It is a copy of https://github.com/railwayapp-templates/caddy-reverse-proxy/tree/main without the BACKEND variables.

I have another service running with the private domain of wizard-dev.railway.internalyou can check it at: https://wizard-dev-production.up.railway.app/?folder=/home/coder/project

It should route https://wizard-proxy-production.up.railway.app/ to https://wizard-dev-production.up.railway.app/

I want to setup a development server and a running project, and connect them with Caddy.

Any help appreciated!

Solved

3 Replies

10 months ago

Here is a template that puts it all together for you - https://railway.app/template/Vk1mOH

I have spun it up and started the typical express hello world app inside of the Code Server service and confirmed the Proxy service can access the express app as intended.

Some things to note -

  • Since the Proxy service accesses the Code Server service over the IPv6 only private network, the apps you run inside the Code Server service need to listen on the host ::

  • The Proxy service's PROXY_PORT variable is set to 3000 by default, you may need to change that depending on what port you run the app within the Code Server on.

  • There would be no need to change the Proxy's PROXY_HOST variable as we always want that to reference the Code Server's private domain.


Status changed to Solved railway[bot] 10 months ago


p4ulcristianHOBBY

10 months ago

Thank you very much, I missed the "::" part in my code. It works indeed. My lack of understanding between the differences between IPV4 and IPV6 was the problem.


10 months ago

No problem!