Hello, I’m new to caddy here, and so far have been amazed at the ease of setup, but there’s something I can’t quite figure out how to do. I want to rewrite (I think) a subdomain to an external site. For example, someone visits blog.example.com and they’ll see whatever is at exampleblog.com, but without getting redirected.
I tried
blog. example .com:80 {
rewrite / {
to http://exampleblog. com:80
}
tls off
}
The redirect below does work, but I don’t want the user to be able to see the redirect, and would prefer it happen all in the background.
It actually sounds like what you want is a reverse proxy - that is, you connect to Caddy, Caddy goes and fetches whatever is at the external site and returns it to you - no redirections, and you see the subdomain you put in originally, not the external site address.
Hello @Whitestrake,
Ah, okay. Thank you for that! So after reading that example, reverse proxy worked like a charm for http, but not quite for https, but I think that it’s actually a port forwarding issue now.