1. Caddy version (caddy version
):
v2.5.2 h1:eCJdLyEyAGzuQTa5Mh3gETnYWDClo1LjtQm2q9RNZrs=
2. How I run Caddy:
To avoid the “context deadline exceeded” issue (Context Deadline Exceeded on Admin API Call - #2 by matt) I have to run two instances of Caddy: one to serve the dashboard website (the public-facing instance) and another to configure how to serve users’ websites.
a. System environment:
rod@staging:~$ uname -a
Linux staging 5.4.0-122-generic #138-Ubuntu SMP Wed Jun 22 15:00:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
b. Command:
# Public-facing
sudo systemctl start caddy
# Internal
sudo systemctl start caddy-api
c. Service/unit/compose file:
I had to remove the units’ properties because there is a 32000 charater limit so I’ll post them as a separate comment.
d. My complete Caddyfile or JSON config:
Public instance’s Caddyfile:
rod@staging:~$ caddy fmt /etc/caddy/Caddyfile
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
{
debug
admin localhost:2018
}
staticful.net {
handle /api {
reverse_proxy localhost:4000
}
# Taken from https://socket.io/docs/v3/reverse-proxy/#caddy-2
rewrite /sio /sio/
handle /sio/* {
uri strip_prefix /sio
rewrite * /socket.io{path}
reverse_proxy localhost:5000 {
header_up Host {host}
header_up X-Real-IP {remote}
}
}
handle {
# Set this path to your site's directory.
# root * /usr/share/caddy
root * /var/www/html
try_files {path} /index.html
# Enable the static file server.
file_server
}
}
http:// {
reverse_proxy http://localhost:9010
}
https:// {
reverse_proxy 127.0.0.1:9001
}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
I added sink logs to the public instance via the admin API, so here is the public instance’s config via curl http://localhost:2018/config/ | jq
:
{
"admin": {
"listen": "localhost:2018"
},
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"group": "group4",
"handle": [
{
"handler": "rewrite",
"uri": "/sio/"
}
],
"match": [
{
"path": [
"/sio"
]
}
]
},
{
"group": "group3",
"handle": [
{
"handler": "subroute",
"routes": [
{
"group": "group1",
"handle": [
{
"handler": "rewrite",
"uri": "/socket.io{http.request.uri.path}"
}
]
},
{
"handle": [
{
"handler": "rewrite",
"strip_path_prefix": "/sio"
},
{
"handler": "reverse_proxy",
"headers": {
"request": {
"set": {
"Host": [
"{http.request.host}"
],
"X-Real-Ip": [
"{http.request.remote}"
]
}
}
},
"upstreams": [
{
"dial": "localhost:5000"
}
]
}
]
}
]
}
],
"match": [
{
"path": [
"/sio/*"
]
}
]
},
{
"group": "group3",
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "localhost:4000"
}
]
}
]
}
]
}
],
"match": [
{
"path": [
"/api"
]
}
]
},
{
"group": "group3",
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "vars",
"root": "/var/www/html"
}
]
},
{
"handle": [
{
"handler": "rewrite",
"uri": "{http.matchers.file.relative}"
}
],
"match": [
{
"file": {
"try_files": [
"{http.request.uri.path}",
"/index.html"
]
}
}
]
},
{
"handle": [
{
"handler": "file_server",
"hide": [
"/etc/caddy/Caddyfile"
]
}
]
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"staticful.net"
]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "127.0.0.1:9001"
}
]
}
]
}
]
}
],
"terminal": true
}
],
"tls_connection_policies": [
{}
]
},
"srv1": {
"listen": [
":80"
],
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "localhost:9010"
}
]
}
]
}
]
}
}
}
},
"logging": {
"logs": {
"default": {
"level": "DEBUG"
}
},
"sink": {
"writer": {
"filename": "/var/log/caddy/sink-pub.log",
"output": "file"
}
}
}
}
Internal instance’s config via curl http://localhost:2019/config/ | jq
:
{
"apps": {
"http": {
"http_port": 9010,
"https_port": 9001,
"servers": {
"srv0": {
"listen": [
":9001"
],
"routes": [
{
"@id": "randomer-html5-boilerplate",
"group": "user-site",
"handle": [
{
"handler": "reverse_proxy",
"headers": {
"request": {
"set": {
"Host": [
"{upstream_hostport}"
]
}
}
},
"rewrite": {
"uri": "/randomer-html5-boilerplate{http.request.orig_uri}"
},
"upstreams": [
{
"dial": "s3-website.localhost:8000"
}
]
}
],
"match": [
{
"host": [
"prrtz.com"
]
}
],
"terminal": true
}
]
}
}
}
},
"logging": {
"logs": {
"default": {
"encoder": {
"format": "json",
"time_format": "iso8601"
},
"level": "DEBUG",
"writer": {
"filename": "/var/log/caddy/default.log",
"output": "file"
}
}
},
"sink": {
"writer": {
"filename": "/var/log/caddy/sink-api.log",
"output": "file"
}
}
}
}
3. The problem I’m having:
I’m expecting both Caddy instances to share the certificate storage as it says here: Automatic HTTPS — Caddy Documentation but looking at the logs it seems like the public instance isn’t finding the prrtz.com certificate issued earlier by the internal instance at timestamp 2022-07-22T21:22:22.663+0300
(logs from the previous run via sudo cat /var/log/caddy/default.log
):
(I had to remove full logs because there is a limit of 32000 characters per post)
{"level":"info","ts":"2022-07-22T21:22:22.663+0300","logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"prrtz.com"}
{"level":"info","ts":"2022-07-22T21:22:22.663+0300","logger":"tls.obtain","msg":"releasing lock","identifier":"prrtz.com"}
{"level":"debug","ts":"2022-07-22T21:22:22.663+0300","logger":"tls","msg":"loading managed certificate","domain":"prrtz.com","expiration":"2022-10-20T17:22:20.000Z","issuer_key":"acme-v02.api.letsencrypt.org-directory","storage":"FileStorage:/var/lib/caddy/.local/share/caddy"}
{"level":"debug","ts":"2022-07-22T21:22:22.862+0300","logger":"tls.cache","msg":"added certificate to cache","subjects":["prrtz.com"],"expiration":"2022-10-20T17:22:20.000Z","managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"33887b87cafc18802ce19b2b12bc6da820a407669a15da27c3debc956fd43753","cache_size":1,"cache_capacity":10000}
When I curl a user’s site (prrtz.com is pointed at this machine’s IP address) I expect the public Caddy instance to find the certificate in the shared storage and serve a successful response, but looks like it doesn’t (error no certificate matching TLS ClientHello
at the bottom of public instance’s logs).
rod@staging:~$ curl -v https://prrtz.com
* Trying 89.223.64.2:443...
* TCP_NODELAY set
* Connected to prrtz.com (89.223.64.2) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS alert, internal error (592):
* error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
* Closing connection 0
curl: (35) error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
4. Error messages and/or full log output:
Public instance
rod@staging:~$ sudo systemctl status caddy | cat
● caddy.service - Caddy
Loaded: loaded (/etc/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-07-23 18:52:37 MSK; 25min ago
Docs: https://caddyserver.com/docs/
Main PID: 45053 (caddy)
Tasks: 7 (limit: 2274)
Memory: 8.1M
CGroup: /system.slice/caddy.service
└─45053 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
Jul 23 18:52:41 staging caddy[45053]: {"level":"info","ts":1658591561.5238678,"logger":"admin.api","msg":"received request","method":"GET","host":"localhost:2018","uri":"/config/","remote_ip":"127.0.0.1","remote_port":"60876","headers":{"Accept":["*/*"],"User-Agent":["curl/7.68.0"]}}
Jul 23 18:52:46 staging caddy[45053]: {"level":"info","ts":1658591566.154822,"logger":"admin.api","msg":"received request","method":"GET","host":"localhost:2018","uri":"/config/","remote_ip":"127.0.0.1","remote_port":"60880","headers":{"Accept":["*/*"],"User-Agent":["curl/7.68.0"]}}
Jul 23 18:55:28 staging caddy[45053]: {"level":"debug","ts":1658591728.0174782,"logger":"http.handlers.reverse_proxy","msg":"selected upstream","dial":"localhost:9010","total_upstreams":1}
Jul 23 18:55:28 staging caddy[45053]: {"level":"debug","ts":1658591728.023302,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"localhost:9010","duration":0.003604083,"request":{"remote_ip":"185.7.214.104","remote_port":"57202","proto":"HTTP/1.1","method":"POST","host":"89.223.64.2:80","uri":"/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php","headers":{"Content-Type":["application/x-www-form-urlencoded"],"Accept-Encoding":["gzip"],"X-Forwarded-For":["185.7.214.104"],"X-Forwarded-Proto":["http"],"X-Forwarded-Host":["89.223.64.2:80"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"],"Content-Length":["19"]}},"headers":{"Date":["Sat, 23 Jul 2022 15:55:28 GMT"],"Content-Length":["0"],"Location":["https://89.223.64.2/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php"],"Server":["Caddy"]},"status":308}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9190598,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"prrtz.com"}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9204192,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.com"}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9204297,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.*"}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.920449,"logger":"tls.handshake","msg":"all external certificate managers yielded no certificates and no errors","sni":"prrtz.com"}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9204834,"logger":"tls.handshake","msg":"no certificate matching TLS ClientHello","server_name":"prrtz.com","remote":"89.223.64.2:49004","identifier":"prrtz.com","cipher_suites":[4866,4867,4865,49196,49200,159,52393,52392,52394,49195,49199,158,49188,49192,107,49187,49191,103,49162,49172,57,49161,49171,51,157,156,61,60,53,47,255],"cert_cache_fill":0.0001,"load_if_necessary":true,"obtain_if_necessary":true,"on_demand":false}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9213223,"logger":"http.stdlib","msg":"http: TLS handshake error from 89.223.64.2:49004: no certificate available for 'prrtz.com'"}
Public instance logs (sudo journalctl -u caddy --no-pager
):
Jul 23 18:52:37 staging systemd[1]: Starting Caddy...
Jul 23 18:52:37 staging caddy[45053]: caddy.HomeDir=/var/lib/caddy
Jul 23 18:52:37 staging caddy[45053]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
Jul 23 18:52:37 staging caddy[45053]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
Jul 23 18:52:37 staging caddy[45053]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
Jul 23 18:52:37 staging caddy[45053]: caddy.Version=v2.5.2 h1:eCJdLyEyAGzuQTa5Mh3gETnYWDClo1LjtQm2q9RNZrs=
Jul 23 18:52:37 staging caddy[45053]: runtime.GOOS=linux
Jul 23 18:52:37 staging caddy[45053]: runtime.GOARCH=amd64
Jul 23 18:52:37 staging caddy[45053]: runtime.Compiler=gc
Jul 23 18:52:37 staging caddy[45053]: runtime.NumCPU=1
Jul 23 18:52:37 staging caddy[45053]: runtime.GOMAXPROCS=1
Jul 23 18:52:37 staging caddy[45053]: runtime.Version=go1.18.3
Jul 23 18:52:37 staging caddy[45053]: os.Getwd=/
Jul 23 18:52:37 staging caddy[45053]: LANG=en_US.UTF-8
Jul 23 18:52:37 staging caddy[45053]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
Jul 23 18:52:37 staging caddy[45053]: NOTIFY_SOCKET=/run/systemd/notify
Jul 23 18:52:37 staging caddy[45053]: HOME=/var/lib/caddy
Jul 23 18:52:37 staging caddy[45053]: LOGNAME=caddy
Jul 23 18:52:37 staging caddy[45053]: USER=caddy
Jul 23 18:52:37 staging caddy[45053]: INVOCATION_ID=a5972514769b4a7a9547c70985fd5e4d
Jul 23 18:52:37 staging caddy[45053]: JOURNAL_STREAM=9:1510010
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4328818,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Jul 23 18:52:37 staging caddy[45053]: {"level":"warn","ts":1658591557.440443,"msg":"Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":10}
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4494333,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2018","enforce_origin":false,"origins":["//localhost:2018","//[::1]:2018","//127.0.0.1:2018"]}
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4501128,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
Jul 23 18:52:37 staging caddy[45053]: {"level":"warn","ts":1658591557.4502773,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv1","http_port":80}
Jul 23 18:52:37 staging caddy[45053]: {"level":"debug","ts":1658591557.4540946,"logger":"http","msg":"starting server loop","address":"[::]:443","http3":false,"tls":true}
Jul 23 18:52:37 staging caddy[45053]: {"level":"debug","ts":1658591557.4544847,"logger":"http","msg":"starting server loop","address":"[::]:80","http3":false,"tls":false}
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4546406,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["staticful.net"]}
Jul 23 18:52:37 staging caddy[45053]: {"level":"debug","ts":1658591557.4555428,"logger":"tls","msg":"loading managed certificate","domain":"staticful.net","expiration":1666276983,"issuer_key":"acme-v02.api.letsencrypt.org-directory","storage":"FileStorage:/var/lib/caddy/.local/share/caddy"}
Jul 23 18:52:37 staging caddy[45053]: {"level":"debug","ts":1658591557.4574065,"logger":"tls.cache","msg":"added certificate to cache","subjects":["staticful.net"],"expiration":1666276983,"managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"45df2719cbbd113833576c3e1c68d6b9e39e66ac139112fdb89f2d9e0845e2b7","cache_size":1,"cache_capacity":10000}
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4584486,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
Jul 23 18:52:37 staging systemd[1]: Started Caddy.
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4661975,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0003eaf50"}
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4665065,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/var/lib/caddy/.local/share/caddy"}
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4681902,"logger":"tls","msg":"finished cleaning storage units"}
Jul 23 18:52:37 staging caddy[45053]: {"level":"info","ts":1658591557.4705985,"msg":"serving initial configuration"}
Jul 23 18:52:41 staging caddy[45053]: {"level":"info","ts":1658591561.5238678,"logger":"admin.api","msg":"received request","method":"GET","host":"localhost:2018","uri":"/config/","remote_ip":"127.0.0.1","remote_port":"60876","headers":{"Accept":["*/*"],"User-Agent":["curl/7.68.0"]}}
Jul 23 18:52:46 staging caddy[45053]: {"level":"info","ts":1658591566.154822,"logger":"admin.api","msg":"received request","method":"GET","host":"localhost:2018","uri":"/config/","remote_ip":"127.0.0.1","remote_port":"60880","headers":{"Accept":["*/*"],"User-Agent":["curl/7.68.0"]}}
Jul 23 18:55:28 staging caddy[45053]: {"level":"debug","ts":1658591728.0174782,"logger":"http.handlers.reverse_proxy","msg":"selected upstream","dial":"localhost:9010","total_upstreams":1}
Jul 23 18:55:28 staging caddy[45053]: {"level":"debug","ts":1658591728.023302,"logger":"http.handlers.reverse_proxy","msg":"upstream roundtrip","upstream":"localhost:9010","duration":0.003604083,"request":{"remote_ip":"185.7.214.104","remote_port":"57202","proto":"HTTP/1.1","method":"POST","host":"89.223.64.2:80","uri":"/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php","headers":{"Content-Type":["application/x-www-form-urlencoded"],"Accept-Encoding":["gzip"],"X-Forwarded-For":["185.7.214.104"],"X-Forwarded-Proto":["http"],"X-Forwarded-Host":["89.223.64.2:80"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"],"Content-Length":["19"]}},"headers":{"Date":["Sat, 23 Jul 2022 15:55:28 GMT"],"Content-Length":["0"],"Location":["https://89.223.64.2/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php"],"Server":["Caddy"]},"status":308}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9190598,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"prrtz.com"}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9204192,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.com"}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9204297,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.*"}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.920449,"logger":"tls.handshake","msg":"all external certificate managers yielded no certificates and no errors","sni":"prrtz.com"}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9204834,"logger":"tls.handshake","msg":"no certificate matching TLS ClientHello","server_name":"prrtz.com","remote":"89.223.64.2:49004","identifier":"prrtz.com","cipher_suites":[4866,4867,4865,49196,49200,159,52393,52392,52394,49195,49199,158,49188,49192,107,49187,49191,103,49162,49172,57,49161,49171,51,157,156,61,60,53,47,255],"cert_cache_fill":0.0001,"load_if_necessary":true,"obtain_if_necessary":true,"on_demand":false}
Jul 23 19:01:11 staging caddy[45053]: {"level":"debug","ts":1658592071.9213223,"logger":"http.stdlib","msg":"http: TLS handshake error from 89.223.64.2:49004: no certificate available for 'prrtz.com'"}
Public instance sink log (sudo cat /var/log/caddy/sink-pub.log
):
[INFO] Redirected sink to here (/var/log/caddy/sink-pub.log)
Internal instance
rod@staging:~$ sudo systemctl status caddy-api | cat
● caddy-api.service - Caddy
Loaded: loaded (/etc/systemd/system/caddy-api.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/caddy-api.service.d
└─override.conf
Active: active (running) since Sat 2022-07-23 18:53:30 MSK; 25min ago
Docs: https://caddyserver.com/docs/
Main PID: 45081 (caddy)
Tasks: 6 (limit: 2274)
Memory: 7.4M
CGroup: /system.slice/caddy-api.service
└─45081 /usr/bin/caddy run --environ --resume
Jul 23 18:53:30 staging caddy[45081]: HOME=/var/lib/caddy
Jul 23 18:53:30 staging caddy[45081]: LOGNAME=caddy
Jul 23 18:53:30 staging caddy[45081]: USER=caddy
Jul 23 18:53:30 staging caddy[45081]: INVOCATION_ID=6aa7f710450b4cd2982d2dfdd25f99f1
Jul 23 18:53:30 staging caddy[45081]: JOURNAL_STREAM=9:1510286
Jul 23 18:53:30 staging caddy[45081]: XDG_CONFIG_HOME=/var/lib/caddy-api
Jul 23 18:53:30 staging caddy[45081]: {"level":"info","ts":1658591610.716091,"msg":"resuming from last configuration","autosave_file":"/var/lib/caddy-api/caddy/autosave.json"}
Jul 23 18:53:30 staging caddy[45081]: {"level":"info","ts":1658591610.717915,"msg":"[INFO] Redirecting sink to: /var/log/caddy/sink-api.log"}
Jul 23 18:53:30 staging caddy[45081]: {"level":"info","ts":1658591610.7183805,"msg":"redirected default logger","from":"stderr","to":"/var/log/caddy/default.log"}
Jul 23 18:53:30 staging systemd[1]: Started Caddy.
Internal instance default log (sudo cat /var/log/caddy/default.log
):
{"level":"info","ts":"2022-07-23T18:53:30.725+0300","logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["//127.0.0.1:2019","//localhost:2019","//[::1]:2019"]}
{"level":"info","ts":"2022-07-23T18:53:30.726+0300","logger":"http","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":9001}
{"level":"info","ts":"2022-07-23T18:53:30.726+0300","logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"debug","ts":"2022-07-23T18:53:30.726+0300","logger":"http","msg":"starting server loop","address":"[::]:9001","http3":false,"tls":true}
{"level":"debug","ts":"2022-07-23T18:53:30.726+0300","logger":"http","msg":"starting server loop","address":"[::]:9010","http3":false,"tls":false}
{"level":"info","ts":"2022-07-23T18:53:30.726+0300","logger":"http","msg":"enabling automatic TLS certificate management","domains":["prrtz.com"]}
{"level":"debug","ts":"2022-07-23T18:53:30.727+0300","logger":"tls","msg":"loading managed certificate","domain":"prrtz.com","expiration":"2022-10-20T17:22:20.000Z","issuer_key":"acme-v02.api.letsencrypt.org-directory","storage":"FileStorage:/var/lib/caddy/.local/share/caddy"}
{"level":"debug","ts":"2022-07-23T18:53:30.727+0300","logger":"tls.cache","msg":"added certificate to cache","subjects":["prrtz.com"],"expiration":"2022-10-20T17:22:20.000Z","managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"33887b87cafc18802ce19b2b12bc6da820a407669a15da27c3debc956fd43753","cache_size":1,"cache_capacity":10000}
{"level":"info","ts":"2022-07-23T18:53:30.727+0300","msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy-api/caddy/autosave.json"}
{"level":"info","ts":"2022-07-23T18:53:30.734+0300","logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000285490"}
{"level":"info","ts":"2022-07-23T18:53:30.734+0300","logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/var/lib/caddy/.local/share/caddy"}
{"level":"info","ts":"2022-07-23T18:53:30.736+0300","logger":"tls","msg":"finished cleaning storage units"}
{"level":"info","ts":"2022-07-23T18:53:30.738+0300","msg":"serving initial configuration"}
{"level":"info","ts":"2022-07-23T18:53:37.118+0300","logger":"admin.api","msg":"received request","method":"GET","host":"localhost:2019","uri":"/config/","remote_ip":"127.0.0.1","remote_port":"42028","headers":{"Accept":["*/*"],"User-Agent":["curl/7.68.0"]}}
Internal instance sink log (sudo cat /var/log/caddy/sink-api.log
):
[INFO] Redirected sink to here (/var/log/caddy/sink-api.log)
5. What I already tried:
At first I ran the internal Caddy instance via the sudo -H -u caddy bash -c 'caddy run'
command, but that didn’t work either and gave me the same error. Unfortunately I’m stuck now as I’m not sure what else I should try.