Redirect non-www to www
rustam
HOBBYOP

4 months ago

I want to redirect traffic from non-www to www.

The application is deployed using a Dockerfile, and I’m attempting to configure this redirect using Caddy.

However, Railway’s edge proxy performs the HTTP to HTTPS redirect before the request reaches Caddy.

How can this be resolved?

$10 Bounty

1 Replies

4 months ago

Try adding both domains in Railway (so both get SSL), then handle the non-www to www redirect inside Caddy. railway's edge handles HTTPS, but it forwards the original Host header to your container.

Did you try this?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...