mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-04 06:43:45 +08:00
112 lines
1.9 KiB
Plaintext
112 lines
1.9 KiB
Plaintext
localhost
|
|
|
|
root * /srv
|
|
|
|
handle /nope* {
|
|
file_server {
|
|
status 403
|
|
}
|
|
}
|
|
|
|
handle /custom-status* {
|
|
file_server {
|
|
status {env.CUSTOM_STATUS}
|
|
}
|
|
}
|
|
----------
|
|
{
|
|
"apps": {
|
|
"http": {
|
|
"servers": {
|
|
"srv0": {
|
|
"listen": [
|
|
":443"
|
|
],
|
|
"routes": [
|
|
{
|
|
"match": [
|
|
{
|
|
"host": [
|
|
"localhost"
|
|
]
|
|
}
|
|
],
|
|
"handle": [
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "vars",
|
|
"root": "/srv"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"group": "group2",
|
|
"handle": [
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "file_server",
|
|
"hide": [
|
|
"./Caddyfile"
|
|
],
|
|
"status_code": "{env.CUSTOM_STATUS}"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"match": [
|
|
{
|
|
"path": [
|
|
"/custom-status*"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"group": "group2",
|
|
"handle": [
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "file_server",
|
|
"hide": [
|
|
"./Caddyfile"
|
|
],
|
|
"status_code": 403
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"match": [
|
|
{
|
|
"path": [
|
|
"/nope*"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"terminal": true
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |