Created
February 24, 2020 09:49
-
-
Save aondio/1013f3599d0950f6de10d86af061a0fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
varnishtest "implementing x-accel-redirect" | |
server s1 { | |
rxreq | |
expect req.url == "/s1" | |
txresp -hdr "X-Accel-Redirect: /s2" | |
rxreq | |
expect req.url == "/s2" | |
txresp | |
} -start | |
varnish v1 -vcl+backend { | |
sub vcl_deliver { | |
if (resp.http.X-Accel-Redirect) { | |
set req.url = resp.http.X-Accel-Redirect; | |
return (restart); | |
} | |
set resp.http.X-url = req.url; | |
} | |
} -start | |
client c1 { | |
txreq -url "/s1" | |
rxresp | |
expect resp.http.X-url == "/s2" | |
} -run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment