1. The problem I’m having:
I have turned off set the global option “auto_https disable_redirects”, as I do use DNS challenges for letsencrypt and most of my virtual hosts due not need to support http://, but for one of my hosts I need for backward compatibility to support, so this particular host has a config to listen to http;:// explicitly.
This naturally causes caddy to listen to port 80 for all the virtual hosts, not only the one that is explicitly enabled. If caddy does not find a listener, it simply issues the standard access.log message “handled_request” with status 0, which is a little unhelpful. It would be better to have a warning for this case I believe.
2. Error messages and/or full log output:
{
"insertId": "kj8maafleqnue",
"jsonPayload": {
"duration": 0.116915129,
"user_id": "",
"request": {
"method": "GET",
"uri": "redacted",
"proto": "HTTP/3.0",
"client_ip": "redacted",
"remote_port": "52310",
"host": "redacted",
"tls": {
"cipher_suite": 4865,
"resumed": false,
"proto": "h3",
"version": 772,
"server_name": "redacted"
},
"remote_ip": "redacted",
"headers": {
"User-Agent": [
"redacted"
],
"Accept-Language": [
"de-DE,de;q=0.9"
],
"Cookie": [],
"Accept-Encoding": [
"gzip"
],
"Priority": [
"u=3"
],
"Accept": [
"*/*"
]
}
},
"size": 0,
"status": 0,
"instance": {
"name": "redacted"
},
"logger": "http.log.access",
"message": "handled request",
"resp_headers": {
"Server": [
"Caddy"
]
},
"bytes_read": 0,
"container": {
"imageName": "jumager/caddy:release",
"name": "/caddy",
"imageId": "sha256:f9e476a67182a9c84b63b81fd4151db9c35511a4aaa9eb6dfc690c678be63830",
"id": "a2c7cd280864d4beba891675fe0f5fc83bb6f6e01a284d8743a881524eb454a0",
"created": "2024-05-16T14:05:44.984231011Z"
}
},
"httpRequest": {
"requestMethod": "GET",
"requestUrl": "https://service.sample.app/url_redacted",
"userAgent": "redacted",
"remoteIp": "redacted",
"latency": "0.116915129s",
"protocol": "HTTP/3.0"
},
"resource": {
"type": "gce_instance",
"labels": {
"zone": "",
"instance_id": "",
"project_id": "redacted"
}
},
"timestamp": "2024-05-17T12:45:18.294151671Z",
"severity": "INFO",
"logName": "projects/redacted logs/ngcplogs-docker-driver",
"trace": "projects/redacted/traces/1397404b82f44ecd3862c43d7d9c63c8",
"receiveTimestamp": "2024-05-17T12:45:19.305970934Z"
}
3. Caddy version:
v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
4. How I installed and ran Caddy:
Docker with custom modules, see below.
a. System environment:
Various, ARM Ampere and Intel based vservers.
b. Command:
docker compose up -d
c. Service/unit/compose file:
See https://github.com/jum/caddy-docker-proxy-redis`
d. My complete Caddy config:
See https://github.com/jum/caddy-docker-proxy-redis/blob/master/caddy/config/Caddyfile