aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddytest/integration/caddyfile_adapt
diff options
context:
space:
mode:
authorMohammed Al Sahaf <[email protected]>2024-08-22 22:52:05 +0300
committerGitHub <[email protected]>2024-08-22 19:52:05 +0000
commit4ade967005929e98ae2265d9d7c89b33f1ca951b (patch)
tree1933e4b283afe4ade6412a51fd403da4af662e31 /caddytest/integration/caddyfile_adapt
parent8af646730be93f4a00b873d1822bfde6be106696 (diff)
downloadcaddy-4ade967005929e98ae2265d9d7c89b33f1ca951b.tar.gz
caddy-4ade967005929e98ae2265d9d7c89b33f1ca951b.zip
reverseproxy: allow user to define source address (#6504)
* reverseproxy: allow user to define source address Closes #6503 Signed-off-by: Mohammed Al Sahaf <[email protected]> * reverse_proxy: caddyfile support for local_address Signed-off-by: Mohammed Al Sahaf <[email protected]> --------- Signed-off-by: Mohammed Al Sahaf <[email protected]>
Diffstat (limited to 'caddytest/integration/caddyfile_adapt')
-rw-r--r--caddytest/integration/caddyfile_adapt/reverse_proxy_localaddr.caddyfiletest57
1 files changed, 57 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/reverse_proxy_localaddr.caddyfiletest b/caddytest/integration/caddyfile_adapt/reverse_proxy_localaddr.caddyfiletest
new file mode 100644
index 000000000..d734c9ce0
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/reverse_proxy_localaddr.caddyfiletest
@@ -0,0 +1,57 @@
+https://example.com {
+ reverse_proxy http://localhost:54321 {
+ transport http {
+ local_address 192.168.0.1
+ }
+ }
+}
+
+----------
+{
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":443"
+ ],
+ "routes": [
+ {
+ "match": [
+ {
+ "host": [
+ "example.com"
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "handler": "reverse_proxy",
+ "transport": {
+ "local_address": "192.168.0.1",
+ "protocol": "http"
+ },
+ "upstreams": [
+ {
+ "dial": "localhost:54321"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "terminal": true
+ }
+ ]
+ }
+ }
+ }
+ }
+}