-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
956f011
commit 73a0059
Showing
4 changed files
with
147 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
caddytest/integration/caddyfile_adapt/reverse_proxy_handle_response.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
:8884 | ||
|
||
reverse_proxy 127.0.0.1:65535 { | ||
handle_response header X-Accel-Redirect { | ||
respond "Header!" | ||
} | ||
handle_response status 401 { | ||
respond "Status!" | ||
} | ||
handle_response { | ||
respond "Any!" | ||
} | ||
} | ||
---------- | ||
{ | ||
"apps": { | ||
"http": { | ||
"servers": { | ||
"srv0": { | ||
"listen": [ | ||
":8884" | ||
], | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handle_response": [ | ||
{ | ||
"match": { | ||
"headers": { | ||
"X-Accel-Redirect": [] | ||
} | ||
}, | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"body": "Header!", | ||
"handler": "static_response" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"match": { | ||
"status_code": [ | ||
401 | ||
] | ||
}, | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"body": "Status!", | ||
"handler": "static_response" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"match": {}, | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"body": "Any!", | ||
"handler": "static_response" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"handler": "reverse_proxy", | ||
"upstreams": [ | ||
{ | ||
"dial": "127.0.0.1:65535" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters