mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-25 09:40:13 +08:00
3cfefeb0f7
* httpcaddyfile: First pass at implementing server options * httpcaddyfile: Add listener wrapper support * httpcaddyfile: Sort sbaddrs to make adapt output more deterministic * httpcaddyfile: Add server options adapt tests * httpcaddyfile: Windows line endings lol * caddytest: More windows line endings lol (sorry Matt) * Update caddyconfig/httpcaddyfile/serveroptions.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com> * httpcaddyfile: Reword listener address "matcher" * Apply suggestions from code review Co-authored-by: Matt Holt <mholt@users.noreply.github.com> * httpcaddyfile: Deprecate experimental_http3 option (moved to servers) * httpcaddyfile: Remove validation step, no longer needed Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
83 lines
1.2 KiB
Plaintext
83 lines
1.2 KiB
Plaintext
(logging) {
|
|
log {
|
|
output file /var/log/caddy/{args.0}.access.log
|
|
}
|
|
}
|
|
|
|
a.example.com {
|
|
import logging a.example.com
|
|
}
|
|
|
|
b.example.com {
|
|
import logging b.example.com
|
|
}
|
|
----------
|
|
{
|
|
"logging": {
|
|
"logs": {
|
|
"default": {
|
|
"exclude": [
|
|
"http.log.access.log0",
|
|
"http.log.access.log1"
|
|
]
|
|
},
|
|
"log0": {
|
|
"writer": {
|
|
"filename": "/var/log/caddy/a.example.com.access.log",
|
|
"output": "file"
|
|
},
|
|
"include": [
|
|
"http.log.access.log0"
|
|
]
|
|
},
|
|
"log1": {
|
|
"writer": {
|
|
"filename": "/var/log/caddy/b.example.com.access.log",
|
|
"output": "file"
|
|
},
|
|
"include": [
|
|
"http.log.access.log1"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"apps": {
|
|
"http": {
|
|
"servers": {
|
|
"srv0": {
|
|
"listen": [
|
|
":443"
|
|
],
|
|
"routes": [
|
|
{
|
|
"match": [
|
|
{
|
|
"host": [
|
|
"a.example.com"
|
|
]
|
|
}
|
|
],
|
|
"terminal": true
|
|
},
|
|
{
|
|
"match": [
|
|
{
|
|
"host": [
|
|
"b.example.com"
|
|
]
|
|
}
|
|
],
|
|
"terminal": true
|
|
}
|
|
],
|
|
"logs": {
|
|
"logger_names": {
|
|
"a.example.com": "log0",
|
|
"b.example.com": "log1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |