Browse Source
* reverse_proxy: 1.health check headers can be set through Caddyfile using health_headers directive; 2.health check header host can be set properly * reverse_proxy: replace example with syntax definition inline health_headers directive parse function * bugfix: change caddyfile_adapt testcase file from space to tab * reverseproxy: modify health_header value document as optional and add more test casesmaster
yaxin
4 years ago
committed by
GitHub
3 changed files with 86 additions and 1 deletions
@ -0,0 +1,57 @@ |
|||||
|
:8884 |
||||
|
|
||||
|
reverse_proxy 127.0.0.1:65535 { |
||||
|
health_headers { |
||||
|
Host example.com |
||||
|
X-Header-Key 95ca39e3cbe7 |
||||
|
X-Header-Keys VbG4NZwWnipo 335Q9/MhqcNU3s2TO |
||||
|
X-Empty-Value |
||||
|
} |
||||
|
} |
||||
|
---------- |
||||
|
{ |
||||
|
"apps": { |
||||
|
"http": { |
||||
|
"servers": { |
||||
|
"srv0": { |
||||
|
"listen": [ |
||||
|
":8884" |
||||
|
], |
||||
|
"routes": [ |
||||
|
{ |
||||
|
"handle": [ |
||||
|
{ |
||||
|
"handler": "reverse_proxy", |
||||
|
"health_checks": { |
||||
|
"active": { |
||||
|
"headers": { |
||||
|
"Host": [ |
||||
|
"example.com" |
||||
|
], |
||||
|
"X-Empty-Value": [ |
||||
|
"" |
||||
|
], |
||||
|
"X-Header-Key": [ |
||||
|
"95ca39e3cbe7" |
||||
|
], |
||||
|
"X-Header-Keys": [ |
||||
|
"VbG4NZwWnipo", |
||||
|
"335Q9/MhqcNU3s2TO" |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
"upstreams": [ |
||||
|
{ |
||||
|
"dial": "127.0.0.1:65535" |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue