diff options
author | Francis Lavoie <lavofr@gmail.com> | 2023-05-15 14:14:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 12:14:50 -0600 |
commit | 75b690d248c7681dd974f6179c98a363af417a25 (patch) | |
tree | f0df0da211635df094d6b4b9aa6e3f58a7e577a0 /caddytest/integration/caddyfile_adapt | |
parent | 52d7335c2b1b8424e8971a9b03f51a5f36583535 (diff) |
reverseproxy: Expand port ranges to multiple upstreams in CLI + Caddyfile (#5494)
* reverseproxy: Expand port ranges to multiple upstreams in CLI + Caddyfile
* Add clarifying comment
Diffstat (limited to 'caddytest/integration/caddyfile_adapt')
-rw-r--r-- | caddytest/integration/caddyfile_adapt/reverse_proxy_port_range.txt | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/reverse_proxy_port_range.txt b/caddytest/integration/caddyfile_adapt/reverse_proxy_port_range.txt new file mode 100644 index 0000000..978d8c9 --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/reverse_proxy_port_range.txt @@ -0,0 +1,67 @@ +:8884 { + # Port range + reverse_proxy localhost:8001-8002 + + # Port range with placeholder + reverse_proxy {host}:8001-8002 + + # Port range with scheme + reverse_proxy https://localhost:8001-8002 +} +---------- +{ + "apps": { + "http": { + "servers": { + "srv0": { + "listen": [ + ":8884" + ], + "routes": [ + { + "handle": [ + { + "handler": "reverse_proxy", + "upstreams": [ + { + "dial": "localhost:8001" + }, + { + "dial": "localhost:8002" + } + ] + }, + { + "handler": "reverse_proxy", + "upstreams": [ + { + "dial": "{http.request.host}:8001" + }, + { + "dial": "{http.request.host}:8002" + } + ] + }, + { + "handler": "reverse_proxy", + "transport": { + "protocol": "http", + "tls": {} + }, + "upstreams": [ + { + "dial": "localhost:8001" + }, + { + "dial": "localhost:8002" + } + ] + } + ] + } + ] + } + } + } + } +}
\ No newline at end of file |