1. Caddy version (caddy version
):
v2.1.1 h1:X9k1+ehZPYYrSqBvf/ocUgdLSRIuiNiMo7CvyGUQKeA=
2. How I run Caddy:
Caddy configuration is load from JSON file using the curl endpoint.
a. System environment:
AWS EC2 (Ubuntu 20.04)
b. Command:
curl localhost:2019/load -H 'Content-Type: application/json' -d @final_with_headers.json
c. Service/unit/compose file:
paste full file contents here
d. My complete Caddyfile or JSON config:
{
"admin": {
"disabled": false,
"enforce_origin": true,
"listen": ":2020",
"origins": [
"localhost:2020"
]
},
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"handle": [
{
"handler": "headers",
"response": {
"set": {
"Referrer-Policy": [
"same-origin"
],
"X-Content-Type-Options": [
"nosniff"
],
"X-Frame-Options": [
"DENY"
],
"X-Xss-Protection": [
"1; mode=block"
]
}
}
},
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "vars",
"root": "/var/www/html/frontend/dist/webapp/"
}
]
},
{
"handle": [
{
"handler": "rewrite",
"uri": "{http.matchers.file.relative}"
}
],
"match": [
{
"file": {
"try_files": [
"{http.request.uri.path}",
"{http.request.uri.path}/",
"/index.html"
]
}
}
]
},
{
"handle": [
{
"encodings": {
"gzip": {},
"zstd": {}
},
"handler": "encode"
},
{
"handler": "file_server",
"hide": [
"Caddyfile"
]
}
]
}
]
}
]
}
]
}
}
},
"tls": {
"automation": {
"on_demand": {
"ask": "https://app.example.io/custom-domain/ssl-allowed/"
},
"policies": [
{
"on_demand": true
}
]
}
}
}
}
3. The problem I’m having:
The domain link.example.com
is pointed to the server. When visited, a request a sent to the TLS ask the endpoint to validate the SSL allowed request.
The response received is 200, but no SSL certificate is issued to the domain and the domain is not accessible.
When there is already an SSL certificate generated, how can I remove the SSL for this specific domain to generate a new SSL on request or generate an SSL manually for this domain?
4. Error messages and/or full log output:
No error message is received.