mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-02 22:04:07 +08:00
9ad0ebc956
* caddyhttp: Implement `skip_log` handler * Refactor to use vars middleware Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
110 lines
1.7 KiB
Plaintext
110 lines
1.7 KiB
Plaintext
http://localhost:2020 {
|
|
log
|
|
skip_log /first-hidden*
|
|
skip_log /second-hidden*
|
|
respond 200
|
|
}
|
|
|
|
:2020 {
|
|
respond 418
|
|
}
|
|
----------
|
|
{
|
|
"apps": {
|
|
"http": {
|
|
"servers": {
|
|
"srv0": {
|
|
"listen": [
|
|
":2020"
|
|
],
|
|
"routes": [
|
|
{
|
|
"match": [
|
|
{
|
|
"host": [
|
|
"localhost"
|
|
]
|
|
}
|
|
],
|
|
"handle": [
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "vars",
|
|
"skip_log": true
|
|
}
|
|
],
|
|
"match": [
|
|
{
|
|
"path": [
|
|
"/second-hidden*"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "vars",
|
|
"skip_log": true
|
|
}
|
|
],
|
|
"match": [
|
|
{
|
|
"path": [
|
|
"/first-hidden*"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "static_response",
|
|
"status_code": 200
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"terminal": true
|
|
},
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "static_response",
|
|
"status_code": 418
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"terminal": true
|
|
}
|
|
],
|
|
"automatic_https": {
|
|
"skip": [
|
|
"localhost"
|
|
]
|
|
},
|
|
"logs": {
|
|
"logger_names": {
|
|
"localhost:2020": ""
|
|
},
|
|
"skip_unmapped_hosts": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |