zsenternewmedia

Untitled

Mar 27th, 2012
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. backend default {
  2. .host = "127.0.0.1";
  3. .port = "8081";
  4. }
  5.  
  6. sub vcl_recv {
  7. if (req.url ~ "\.(css|js|jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv)$") {
  8. unset req.http.Cookie;
  9. return(lookup);
  10. }
  11.  
  12. if (req.url ~ "(get_file)" && req.url !~ "admin") {
  13. unset req.http.Cookie;
  14. return(lookup);
  15. }
  16.  
  17. if (req.url ~ "(assets)" && req.url !~ "admin" && req.url && req.request != "POST") {
  18. unset req.http.Cookie;
  19. return(lookup);
  20. }
  21.  
  22. if (req.url ~ "server-status" ) {
  23. error 403;
  24. }
  25.  
  26. set req.backend = default;
  27. }
  28.  
  29. sub vcl_fetch {
  30. if (req.url ~ "(assets)" && req.url !~ "admin" && req.url && req.request != "POST") {
  31. unset beresp.http.Set-Cookie;
  32. set beresp.ttl = 24h;
  33. return(deliver);
  34. }
  35. if (req.url ~ "\.(css|js|jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv)$") {
  36. unset beresp.http.Set-Cookie;
  37. set beresp.ttl = 24h;
  38. return(deliver);
  39. }
  40.  
  41. if (req.url ~ "(get_file)" && req.url !~ "admin") {
  42. unset beresp.http.Set-Cookie;
  43. set beresp.ttl = 24h;
  44. return(deliver);
  45. }
  46. return(deliver);
  47. }
Advertisement
Add Comment
Please, Sign In to add comment