Created
December 18, 2016 15:50
-
-
Save gquintard/3a708c59f2232f9a959b3d374762a1e4 to your computer and use it in GitHub Desktop.
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
varnishtest "30X redirections" | |
server s1 {} | |
varnish v1 -vcl+backend { | |
sub vcl_recv { | |
if (req.http.host != "www.varnish-software.com") { | |
set req.http.location = "https://www.varnish-software.com/"; | |
return(synth(301)); | |
} | |
} | |
sub vcl_synth { | |
if (resp.status == 301 || resp.status == 302) { | |
set resp.http.location = req.http.location; | |
return (deliver); | |
} | |
} | |
} -start | |
client c1 { | |
txreq -hdr "host: varnish" | |
rxresp | |
expect resp.status == 301 | |
expect resp.http.location == "https://www.varnish-software.com/" | |
expect resp.reason == "Moved Permanently" | |
} -run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment