2024-05-01 14:43:05 +03:00
|
|
|
(snippet) {
|
|
|
|
@g `{http.error.status_code} == 404`
|
|
|
|
}
|
|
|
|
|
2022-03-19 00:08:23 +03:00
|
|
|
example.com
|
|
|
|
|
|
|
|
@a expression {http.error.status_code} == 400
|
|
|
|
abort @a
|
|
|
|
|
|
|
|
@b expression {http.error.status_code} == "401"
|
|
|
|
abort @b
|
|
|
|
|
|
|
|
@c expression {http.error.status_code} == `402`
|
|
|
|
abort @c
|
|
|
|
|
|
|
|
@d expression "{http.error.status_code} == 403"
|
|
|
|
abort @d
|
|
|
|
|
|
|
|
@e expression `{http.error.status_code} == 404`
|
|
|
|
abort @e
|
2024-05-01 14:43:05 +03:00
|
|
|
|
|
|
|
@f `{http.error.status_code} == 404`
|
|
|
|
abort @f
|
|
|
|
|
|
|
|
import snippet
|
|
|
|
abort @g
|
2022-03-19 00:08:23 +03:00
|
|
|
----------
|
|
|
|
{
|
|
|
|
"apps": {
|
|
|
|
"http": {
|
|
|
|
"servers": {
|
|
|
|
"srv0": {
|
|
|
|
"listen": [
|
|
|
|
":443"
|
|
|
|
],
|
|
|
|
"routes": [
|
|
|
|
{
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"host": [
|
|
|
|
"example.com"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"handler": "subroute",
|
|
|
|
"routes": [
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"abort": true,
|
|
|
|
"handler": "static_response"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"expression": "{http.error.status_code} == 400"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"abort": true,
|
|
|
|
"handler": "static_response"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"expression": "{http.error.status_code} == \"401\""
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"abort": true,
|
|
|
|
"handler": "static_response"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"expression": "{http.error.status_code} == `402`"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"abort": true,
|
|
|
|
"handler": "static_response"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"match": [
|
|
|
|
{
|
2024-04-17 21:19:14 +03:00
|
|
|
"expression": {
|
|
|
|
"expr": "{http.error.status_code} == 403",
|
|
|
|
"name": "d"
|
|
|
|
}
|
2022-03-19 00:08:23 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"abort": true,
|
|
|
|
"handler": "static_response"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"match": [
|
|
|
|
{
|
2024-04-17 21:19:14 +03:00
|
|
|
"expression": {
|
|
|
|
"expr": "{http.error.status_code} == 404",
|
|
|
|
"name": "e"
|
|
|
|
}
|
2022-03-19 00:08:23 +03:00
|
|
|
}
|
|
|
|
]
|
2024-05-01 14:43:05 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"abort": true,
|
|
|
|
"handler": "static_response"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"expression": {
|
|
|
|
"expr": "{http.error.status_code} == 404",
|
|
|
|
"name": "f"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"handle": [
|
|
|
|
{
|
|
|
|
"abort": true,
|
|
|
|
"handler": "static_response"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"match": [
|
|
|
|
{
|
|
|
|
"expression": {
|
|
|
|
"expr": "{http.error.status_code} == 404",
|
|
|
|
"name": "g"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2022-03-19 00:08:23 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"terminal": true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|