mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-12 21:43:56 +08:00
7d1f7771c9
* reverseproxy: Implement retry count, alternative to try_duration * Add Caddyfile support for `retry_match` * Refactor to deduplicate matcher parsing logic * Fix lint
65 lines
1017 B
Plaintext
65 lines
1017 B
Plaintext
:8884
|
|
|
|
reverse_proxy 127.0.0.1:65535 {
|
|
lb_policy first
|
|
lb_retries 5
|
|
lb_try_duration 10s
|
|
lb_try_interval 500ms
|
|
lb_retry_match {
|
|
path /foo*
|
|
method POST
|
|
}
|
|
lb_retry_match path /bar*
|
|
}
|
|
----------
|
|
{
|
|
"apps": {
|
|
"http": {
|
|
"servers": {
|
|
"srv0": {
|
|
"listen": [
|
|
":8884"
|
|
],
|
|
"routes": [
|
|
{
|
|
"handle": [
|
|
{
|
|
"handler": "reverse_proxy",
|
|
"load_balancing": {
|
|
"retries": 5,
|
|
"retry_match": [
|
|
{
|
|
"method": [
|
|
"POST"
|
|
],
|
|
"path": [
|
|
"/foo*"
|
|
]
|
|
},
|
|
{
|
|
"path": [
|
|
"/bar*"
|
|
]
|
|
}
|
|
],
|
|
"selection_policy": {
|
|
"policy": "first"
|
|
},
|
|
"try_duration": 10000000000,
|
|
"try_interval": 500000000
|
|
},
|
|
"upstreams": [
|
|
{
|
|
"dial": "127.0.0.1:65535"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|