1. Output of caddy version
:
v2.5.1 h1:bAWwslD1jNeCzDa+jDCNwb8M3UJ2tPa8UZFFzPVmGKs=
2. How I run Caddy:
a. System environment:
Windows 2012
Microsoft Windows [Version 6.2.9200]
b. Command:
caddy_windows_amd64.exe run
c. Service/unit/compose file:
n.a.
d. My complete Caddy config:
{
# auto_https disable_redirects
acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
webmail.gezondheidscentrumdesprank.nl {
reverse_proxy 127.0.0.1:8443
}
www.fysiotherapiedemortel.nl {
handle_path /webmail/* {
redir https://webmail.fysiotherapiedemortel.nl
}
redir /webmail /webmail/
handle {
reverse_proxy 127.0.0.1:81
}
}
www.gezondheidscentrumdesprank.nl {
handle_path /webmail/* {
redir https://webmail.gezondheidscentrumdesprank.nl
}
redir /webmail /webmail/
handle {
reverse_proxy 127.0.0.1:81
}
}
ftp.gezondheidscentrumdesprank.nl,
ftp.fysiotherapiedemortel.nl,
secu.fysiotherapiedemortel.nl,
vpn.fysiotherapiedemortel.nl,
xibo.fysiotherapiedemortel.nl {
handle {
reverse_proxy 127.0.0.1:81
}
}
dev.fysiotherapiedemortel.nl,
dev.gezondheidscentrumdesprank.nl {
handle {
reverse_proxy 127.0.0.1:18081
}
}
3. The problem I’m having:
I would like to reverse proxy two domains to underlying servers on the same machine that is hosting caddy (i.e. apache 81 on , IIS on 18081 and kerio mailserver on 8443).
So webmail.[domain].nl needs to be proxied to 8443. dev.[domain].nl needs to be proxied to 18081, and all other subdomains need to be proxied to 81.
This part I can get working with the reverse_proxy directive.
What I furthermore would like to achieve is that when I enter www.[domain].nl/webmail, I get redirected to webmail.[domain].nl.
This seems to be working to.
And lastly, the parts which I can’t get to work, is that kerio hosts it’s file on a path /webmail. However I would lik to rewrite this to /. So that when accessing the webmail, one navigates to webmail.[domain].nl instead of webmail.[domain].nl/webmail/
And of course, all http request should be redirected to https.
Note, the underlying server all transport of non-secure port, but these do rely on the subdomain referer…
4. Error messages and/or full log output:
n.a.