1. Caddy version (caddy version
):
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
2. How I run Caddy:
/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
a. System environment:
Ubuntu 20.04
b. Command:
`/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile`
c. Service/unit/compose file:
NA
d. My complete Caddyfile or JSON config:
(laravel) {
{args.0} {
root * {args.1}/public
tls internal
log
encode zstd gzip
php_fastcgi unix//run/php/php7.4-fpm.sock
file_server
}
}
{
email "tcurdt@*****.org"
acme_ca "https://acme-staging-v02.api.letsencrypt.org/directory"
}
import laravel "dev.jack.de" "/home/deploy/projects/dev.jack.de/current"
import laravel "jack.de" "/home/deploy/projects/jack.de/current"
3. The problem Iâm having:
I am doing a curl
and get a 500 - but I have no clue why.
curl -vk https://dev.jack.de
* Trying 157.90.149.21:443...
* TCP_NODELAY set
* Connected to dev.jack.de (157.90.149.21) 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 handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: [NONE]
* start date: Jan 10 19:42:36 2022 GMT
* expire date: Jan 11 07:42:36 2022 GMT
* issuer: CN=Caddy Local Authority - ECC Intermediate
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x5609f9645860)
> GET / HTTP/2
> Host: dev.jack.de
> user-agent: curl/7.68.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 500
< content-type: text/html; charset=UTF-8
< server: Caddy
< status: 500 Internal Server Error
< content-length: 0
< date: Mon, 10 Jan 2022 20:13:12 GMT
<
* Connection #0 to host dev.jack.de left intact
This could be just the php_fastcgi
- but I am not seeing anything in the log at all. Not even the 500.
I donât see a way to increase logging.
4. Error messages and/or full log output:
caddy.HomeDir=/var/lib/caddy
caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
caddy.AppConfigDir=/var/lib/caddy/.config/caddy
caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
caddy.Version=v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
runtime.GOOS=linux
runtime.GOARCH=amd64
runtime.Compiler=gc
runtime.NumCPU=1
runtime.GOMAXPROCS=1
runtime.Version=go1.17.2
os.Getwd=/
LANG=en_US.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NOTIFY_SOCKET=/run/systemd/notify
HOME=/var/lib/caddy
LOGNAME=caddy
USER=caddy
INVOCATION_ID=8224b82dfc2f432492cdc27e36ce2b46
JOURNAL_STREAM=9:80291
{"level":"info","ts":1641845272.7592227,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
{"level":"warn","ts":1641845272.7643106,"msg":"input is not formatted with 'caddy fmt'","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":2}
{"level":"info","ts":1641845272.769346,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019>
{"level":"info","ts":1641845272.7703288,"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_p>
{"level":"info","ts":1641845272.7718556,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1641845272.7944665,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00027e150"}
{"level":"warn","ts":1641845272.8050685,"logger":"pki.ca.local","msg":"installing root certificate (you might be prompted for password)","path":"storage:pki/authorities/local/root.crt"}
2022/01/10 21:07:52 not NSS security databases found
2022/01/10 21:07:52 define JAVA_HOME environment variable to use the Java trust
{"level":"error","ts":1641845272.81687,"logger":"pki.ca.local","msg":"failed to install root certificate","error":"failed to execute sudo: exit status 1","certificate_file":"storage:pki/authorities>
{"level":"info","ts":1641845272.8179932,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["jack.de","dev.jack.de"]}
{"level":"warn","ts":1641845272.8185227,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [jack.de]: no OCSP server specified in certificate"}
{"level":"warn","ts":1641845272.818999,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [dev.jack.de]: no OCSP server specified in certificate"}
{"level":"info","ts":1641845272.8197517,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
{"level":"info","ts":1641845272.8231714,"msg":"serving initial configuration"}
{"level":"info","ts":1641845272.8234262,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/var/lib/caddy/.local/share/caddy"}
{"level":"info","ts":1641845272.8239908,"logger":"tls","msg":"finished cleaning storage units"}
5. What I already tried:
Iâve tried to redirect the log into a file - but the file never got created. It seems like access logging is not working for some reason. My only possible conclusion is the host is not matching.