Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- varnishtest "Dit is een titel"
- # backend server
- server s1 {
- # /redirect
- rxreq
- expect req.url == "/redirect"
- txresp -body {
- <html>
- Dit is een redirect
- </html>
- }
- # /whatever
- rxreq
- expect req.url == "/whatever"
- txresp -body {
- <html>
- Dit is home
- </html>
- }
- # /home
- rxreq
- expect req.url == "/home"
- txresp -body {
- <html>
- Dit is home
- </html>
- }
- # /dynamisch
- rxreq
- expect req.url == "/dynamisch"
- txresp -body {
- <html>
- Dit is dynamische data
- </html>
- }
- # /statisch
- rxreq
- expect req.url == "/statisch"
- txresp -body {
- <html>
- Voor de include
- <esi:include src="/body" sr="foo"/>
- Na de include
- </html>
- }
- } -start
- # varnish configuratie
- varnish v1 -vcl+backend {
- sub vcl_recv {
- if ( req.url ~ "/home" ) {
- set req.url = "/redirect";
- }
- }
- } -start
- # web client
- client c1 {
- txreq -url "/home"
- rxresp
- expect resp.status == 200
- } -run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement