Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2. sub vcl_fetch {
  3.  
  4. # Ticket #786 ESI includes don't follow 301 and 302 redirects
  5. if ( req.http.x-orig-cc ) {
  6. set beresp.http.cache-control = req.http.x-orig-cc ", " beresp.http.cache-control;
  7. }
  8. if (beresp.status == 307){
  9. set req.http.x-orig-url = req.url;
  10. set req.http.x-orig-cc = beresp.http.cache-control;
  11. set req.url = beresp.http.location;
  12. restart;
  13. }
  14. }
  15.  
  16. # Ticket #786 ESI includes don't follow 301 and 302 redirects
  17. sub vcl_hash {
  18. if (req.restarts > 0 && req.http.x-orig-url) {
  19. set req.hash += req.http.x-orig-url;
  20. } else {
  21. set req.hash += req.url;
  22. }
  23.  
  24. # fra default:
  25. if (req.http.host) {
  26. set req.hash += req.http.host;
  27. } else {
  28. set req.hash += server.ip;
  29. }
  30. return(hash);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement