Browse Source
* httpcaddyfile: ensure hosts to skip can always be collected Previously, some hosts that should be skipped in logging would be missed as the current logic would only collect them after encountering the first server that would log. This change makes sure the ServerLogConfig is initialized before iterating over the server blocks. * httpcaddyfile: add test case for skip hosts behaviormaster
Frederik Ring
4 years ago
committed by
GitHub
2 changed files with 85 additions and 3 deletions
@ -0,0 +1,75 @@ |
|||
one.example.com { |
|||
log |
|||
} |
|||
|
|||
two.example.com { |
|||
} |
|||
|
|||
three.example.com { |
|||
} |
|||
|
|||
example.com { |
|||
} |
|||
---------- |
|||
{ |
|||
"apps": { |
|||
"http": { |
|||
"servers": { |
|||
"srv0": { |
|||
"listen": [ |
|||
":443" |
|||
], |
|||
"routes": [ |
|||
{ |
|||
"match": [ |
|||
{ |
|||
"host": [ |
|||
"three.example.com" |
|||
] |
|||
} |
|||
], |
|||
"terminal": true |
|||
}, |
|||
{ |
|||
"match": [ |
|||
{ |
|||
"host": [ |
|||
"one.example.com" |
|||
] |
|||
} |
|||
], |
|||
"terminal": true |
|||
}, |
|||
{ |
|||
"match": [ |
|||
{ |
|||
"host": [ |
|||
"two.example.com" |
|||
] |
|||
} |
|||
], |
|||
"terminal": true |
|||
}, |
|||
{ |
|||
"match": [ |
|||
{ |
|||
"host": [ |
|||
"example.com" |
|||
] |
|||
} |
|||
], |
|||
"terminal": true |
|||
} |
|||
], |
|||
"logs": { |
|||
"skip_hosts": [ |
|||
"three.example.com", |
|||
"two.example.com", |
|||
"example.com" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue