1. The problem I’m having:
I’m using Caddy API to load JSON config.
{
"admin": {
"disabled": false
},
"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/"
}
]
},
{
"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"
]
}
]
}
]
}
]
}
],
"logs": {}
}
}
},
"tls": {
"automation": {
"on_demand": {
"ask": "https://example.io/custom-domain/ssl-allowed/"
},
"policies": [
{
"on_demand": true
}
]
}
}
}
}
A domain pointed to the server is not generating SSL certification. I need to check the logs but can’t find any log file in /var/log/caddy
directory, even there is no caddy
directory in the $HOME/.local/share/
directory.
2. Error messages and/or full log output:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
3. Caddy version:
v2.4.5 h1:P1mRs6V2cMcagSPn+NWpD+OEYUYLIf6ecOa48cFGeUg=
4. How I installed and ran Caddy:
Caddy installed using apt (ubuntu) and configuration loaded using Caddy API
a. System environment:
Ubuntu 20.04
b. Command:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
c. Service/unit/compose file:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.