Browse Source
* reverseproxy: Implement health_uri, replaces health_path, supports query Also fixes a bug with `health_status` Caddyfile parsing , it would always only take the first character of the status code even if it didn't end with "xx". * reverseproxy: Rename to URI, named logger, warn in Provision (for JSON)master
committed by
GitHub
4 changed files with 123 additions and 6 deletions
@ -0,0 +1,75 @@ |
|||
# Health with query in the uri |
|||
:8443 { |
|||
reverse_proxy localhost:54321 { |
|||
health_uri /health?ready=1 |
|||
health_status 2xx |
|||
} |
|||
} |
|||
|
|||
# Health without query in the uri |
|||
:8444 { |
|||
reverse_proxy localhost:54321 { |
|||
health_uri /health |
|||
health_status 200 |
|||
} |
|||
} |
|||
|
|||
---------- |
|||
{ |
|||
"apps": { |
|||
"http": { |
|||
"servers": { |
|||
"srv0": { |
|||
"listen": [ |
|||
":8443" |
|||
], |
|||
"routes": [ |
|||
{ |
|||
"handle": [ |
|||
{ |
|||
"handler": "reverse_proxy", |
|||
"health_checks": { |
|||
"active": { |
|||
"expect_status": 2, |
|||
"uri": "/health?ready=1" |
|||
} |
|||
}, |
|||
"upstreams": [ |
|||
{ |
|||
"dial": "localhost:54321" |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
] |
|||
}, |
|||
"srv1": { |
|||
"listen": [ |
|||
":8444" |
|||
], |
|||
"routes": [ |
|||
{ |
|||
"handle": [ |
|||
{ |
|||
"handler": "reverse_proxy", |
|||
"health_checks": { |
|||
"active": { |
|||
"expect_status": 200, |
|||
"uri": "/health" |
|||
} |
|||
}, |
|||
"upstreams": [ |
|||
{ |
|||
"dial": "localhost:54321" |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue