Advertisement
Guest User

Untitled

a guest
May 27th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. varnishtest "Dit is een titel"
  2.  
  3. # backend server
  4. server s1 {
  5. # /redirect
  6. rxreq
  7. expect req.url == "/redirect"
  8. txresp -body {
  9. <html>
  10. Dit is een redirect
  11. </html>
  12. }
  13.  
  14. # /whatever
  15. rxreq
  16. expect req.url == "/whatever"
  17. txresp -body {
  18. <html>
  19. Dit is home
  20. </html>
  21. }
  22.  
  23. # /home
  24. rxreq
  25. expect req.url == "/home"
  26. txresp -body {
  27. <html>
  28. Dit is home
  29. </html>
  30. }
  31.  
  32.  
  33.  
  34. # /dynamisch
  35. rxreq
  36. expect req.url == "/dynamisch"
  37. txresp -body {
  38. <html>
  39. Dit is dynamische data
  40. </html>
  41. }
  42.  
  43. # /statisch
  44. rxreq
  45. expect req.url == "/statisch"
  46. txresp -body {
  47. <html>
  48. Voor de include
  49. <esi:include src="/body" sr="foo"/>
  50. Na de include
  51. </html>
  52. }
  53.  
  54. } -start
  55.  
  56. # varnish configuratie
  57. varnish v1 -vcl+backend {
  58.  
  59. sub vcl_recv {
  60. if ( req.url ~ "/home" ) {
  61. set req.url = "/redirect";
  62. }
  63. }
  64.  
  65. } -start
  66.  
  67. # web client
  68. client c1 {
  69.  
  70. txreq -url "/home"
  71. rxresp
  72. expect resp.status == 200
  73.  
  74. } -run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement