1. Caddy version (caddy version
):
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
2. How I run Caddy:
Official docker container, :latest
tag automatically updated.
c. Service/unit/compose file:
caddy:
image: caddy
container_name: caddy
volumes:
- /etc/docker/data/caddy/Caddyfile:/etc/caddy/Caddyfile
- /etc/docker/data/caddy/data:/data
- /etc/docker/data/caddy/config:/config
ports:
- 80:80
- 443:443
- 2015:2015
environment:
- ACME_AGREE=true
restart: unless-stopped
d. My complete Caddyfile or JSON config:
{
admin 0.0.0.0:2015
email me@my.email
# acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
(netMatchers) {
@internet {
not remote_ip 192.168.10.0/24 192.168.20.0/24 172.19.0.0/16 127.0.0.0/8
}
@local {
remote_ip 192.168.10.0/24 192.168.20.0/24 172.19.0.0/16 127.0.0.0/8
}
}
# LAN connection, unavailable from outside
(lanCore) {
log {
level ERROR
format single_field common_log
}
@internet {
not remote_ip 192.168.10.0/24 192.168.20.0/24 172.19.0.0/16
}
@local {
remote_ip 192.168.10.0/24 192.168.20.0/24 172.19.0.0/16
}
respond @internet 200
}
(lan) {
import lanCore
reverse_proxy @local {args.0}
}
(lan-skip-insecure) {
import lanCore
reverse_proxy @local {args.0} {
transport http {
tls
tls_insecure_skip_verify
}
}
}
# internet connection
(internet) {
log {
level ERROR
}
reverse_proxy {args.0}
}
# hosts
https://deluge.erazt.eu {
import lan deluge:8112
}
3. The problem I’m having:
The configuration above sets the logging level to ERROR. Despite that I get logs such as the one below. Please note that "level": "info"
{
"level": "info",
"ts": 1640245717.5262256,
"logger": "http.log.access",
"msg": "handled request",
"request": {
"remote_addr": "172.19.0.1:46784",
"proto": "HTTP/1.1",
"method": "POST",
"host": "deluge.erazt.eu",
"uri": "/json",
"headers": {
"Cookie": [
"_session_id=4d350b8ea7a2774a01dd64f46286b5e16834c0f13653cf1f542720a1669c85ee4290"
],
"Content-Length": [
"62"
],
"User-Agent": [
"GuzzleHttp/6.3.3 curl/7.79.1 PHP/7.3.33"
],
"Content-Type": [
"application/json"
],
"Accept": [
"application/json"
]
}
},
"common_log": "172.19.0.1 - - [23/Dec/2021:07:48:37 +0000] \"POST /json HTTP/1.1\" 308 0",
"user_id": "",
"duration": 0.000039991,
"size": 0,
"status": 308,
"resp_headers": {
"Content-Type": [],
"Server": [
"Caddy"
],
"Connection": [
"close"
],
"Location": [
"https://deluge.erazt.eu/json"
]
}
}