1. My Caddy version (caddy -version
):
v2.0.0-beta10
2. How I run Caddy:
Please provide all of the relevant information and DO NOT REDACT anything except passwords/keys. Thank you!
a. System environment:
Created from Digital Ocean Marketplace app, which uses Ubuntu
b. Command:
caddy start
curl -X POST "http://localhost:2019/load" \
-H "Content-Type: application/json" \
-d @caddy.json
c. My complete caddy.json file:
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [":443"],
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "{IPADDRESS}:1111"
}
]
}
],
"match": [
{
"host": ["api.domain.com"]
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "{IPADDRESS}:5555"
}
]
}
]
}
],
"automatic_https": {
"disable_redirects": false
},
"tls_connection_policies": [{}],
"logs": {}
}
}
},
"tls": {
"automation": {
"policies": [
{
"management": {
"module": "acme",
"ca": "https://acme-v02.api.letsencrypt.org/directory",
"on_demand": true
}
}
],
"on_demand": {
"rate_limit": {
"interval": "10m",
"burst": 2
}
}
}
}
}
}
3. The problem I’m having:
HTTP to HTTPS redirect does not work for domains which generate their SSL certificates on_demand. HTTP to HTTPS redirect only works for api.domain.com
.
4. Error messages and/or full log output:
A curl command to http://domainpointedatserver.com returns nothing. A curl command to https://domainpointedatserver.com returns the correct site.
5. What I already tried:
Everything I could think of including manually setting disable_redirects to false, and listening on port 80.