I am using Caddy as a proxy for many sites on the same server. Some of my sites are not ready for HTTPS. I can route them on HTTP just fine, but if I visit those sites with HTTPS, I get an ugly...
No such site at :443
...error. How can I use Caddy to redirect to HTTP instead?
This works but gives me the error:
siteCanHandleSSL.com {
proxy / 123.123.123.123:80 {
transparent
}
tls [email protected] {
dns route53
max_certs 200
}
}
http://siteCantHandleSLL.com {
proxy / 123.456.654.321:80 {
transparent
}
tls off
}
This gives me a different error:
siteCanHandleSSL.com {
proxy / 123.123.123.123:80 {
transparent
}
tls [email protected] {
dns route53
max_certs 200
}
}
https://siteCantHandleSLL.com {
redir http://{host}{uri}
tls off
}
http://siteCantHandleSLL.com {
proxy / 123.456.654.321:80 {
transparent
}
tls off
}
❯ curl https://surrain.com curl: (60) SSL certificate problem: Invalid certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.
~ ❯ curl -k https://surrain.com No such site at :443%