mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-03 22:34:12 +08:00
108 lines
1.6 KiB
Plaintext
108 lines
1.6 KiB
Plaintext
:8080
|
|
|
|
# With explicit wildcard matcher
|
|
route {
|
|
root * /a
|
|
}
|
|
|
|
# With path matcher
|
|
route {
|
|
root /path /b
|
|
}
|
|
|
|
# With named matcher
|
|
route {
|
|
@named method GET
|
|
root @named /c
|
|
}
|
|
|
|
# With no matcher, assumed to be wildcard
|
|
route {
|
|
root /d
|
|
}
|
|
----------
|
|
{
|
|
"apps": {
|
|
"http": {
|
|
"servers": {
|
|
"srv0": {
|
|
"listen": [
|
|
":8080"
|
|
],
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "vars",
|
|
"root": "/a"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "vars",
|
|
"root": "/b"
|
|
}
|
|
],
|
|
"match": [
|
|
{
|
|
"path": [
|
|
"/path"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "vars",
|
|
"root": "/c"
|
|
}
|
|
],
|
|
"match": [
|
|
{
|
|
"method": [
|
|
"GET"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"handler": "subroute",
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "vars",
|
|
"root": "/d"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |