<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>   I would highly appreciate if I get some help on the following issu:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>   The query string from the end (== erstellen4) is being incorrectly appended to the token because the Varnish is not removing the tags correctly.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>https://xxxxxx.my/aa/?ResetPasswordToken=4P/weCg49hetX25dVAJxGW0i2GcwuN3bB3zxbMiYLo+3Kfpk199F9ZjwvSP3g8mrPq/opmCosoDmkTHYx3CYK+ABEFrF92y+R0V9icpnLep+f+zfPJjVOZ+M6wa1egt+GNktWIdBIruXXREYAboEQyBtHmgGJQe25KoCUvfUe1ySZlcFre5Dk913ktBD/wvwrtt/O6T2e9aUn2aiKkKdtA==&utm_source=acc_activation&utm_medium=email&utm_campaign=FW_new_customer_activation_2-2019032713&utm_content=Zugangsdaten<span style='color:red'>+erstellen4</span><o:p></o:p></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal>This is what I get by looking at the logs:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>After reset password token: <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>4P/weCg49hetX25dVAJxGW0i2GcwuN3bB3zxbMiYLo3Kfpk199F9ZjwvSP3g8mrPq/opmCosoDmkTHYx3CYK ABEFrF92yR0V9icpnLepfzfPJjVOZM6wa1egtGNktWIdBIruXXREYAboEQyBtHmgGJQe25KoCUvfUe1ySZlcFre5Dk913ktBD/wvwrtt/O6T2e9aUn2aiKkKdtA<span style='color:red'>== erstellen4<o:p></o:p></span></p><p class=MsoNormal><span style='color:red'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> <b>This is my varnish config :<o:p></o:p></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>#<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal># Marker to tell the VCL compiler that this VCL has been adapted to the<o:p></o:p></p><p class=MsoNormal># new 4.0 format.<o:p></o:p></p><p class=MsoNormal>vcl 4.0;<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>import directors;<o:p></o:p></p><p class=MsoNormal>import std;<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>acl monitoring {<o:p></o:p></p><p class=MsoNormal>    "localhost";<o:p></o:p></p><p class=MsoNormal>    "192.xxx.xxx.xxx"/32; /* Collector */<o:p></o:p></p><p class=MsoNormal>    "83.xxx.xxx.xxx"/32; /* LB */<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>acl purge {<o:p></o:p></p><p class=MsoNormal>    "xxx.xxx.xxx.xxx"/32; /*  */<o:p></o:p></p><p class=MsoNormal>    "xxx.xxx.xxx.xxx"/32; /*  */<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>include "/etc/varnish/backend.vcl";<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>sub vcl_init {<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>include "/etc/varnish/director.vcl";<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>sub vcl_recv {<o:p></o:p></p><p class=MsoNormal>    # Happens before we check if we have this in cache already.<o:p></o:p></p><p class=MsoNormal>    #<o:p></o:p></p><p class=MsoNormal>    # Typically you clean up the request here, removing cookies you don't need,<o:p></o:p></p><p class=MsoNormal>    #A<o:p></o:p></p><p class=MsoNormal>    #rewriting the request, etc.<o:p></o:p></p><p class=MsoNormal>    #set req.backend_hint = vweb.backend(req.http.X-Forwarded-For);<o:p></o:p></p><p class=MsoNormal>    #set req.backend_hint = fbdirector.backend();<o:p></o:p></p><p class=MsoNormal>    #<o:p></o:p></p><p class=MsoNormal>    # Set hash directory with hashing option X-Forwarded for becuase we use nginx between the client and vanrish<o:p></o:p></p><p class=MsoNormal>    #set req.backend_hint = hashdirector.backend(req.http.X-Forwarded-For);<o:p></o:p></p><p class=MsoNormal>    #<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Monitoring for FortiADC if faild, the proxy is taken out, if all fails then hit maintance page.<o:p></o:p></p><p class=MsoNormal>  if (req.method == "GET" && req.url == "/varnish-status") {<o:p></o:p></p><p class=MsoNormal>   if (client.ip ~ monitoring) {<o:p></o:p></p><p class=MsoNormal>        #if (std.healthy(hashdirector.backend(req.http.X-Forwarded-For))) {<o:p></o:p></p><p class=MsoNormal>            return(synth(200, "OK"));<o:p></o:p></p><p class=MsoNormal>        #} else {<o:p></o:p></p><p class=MsoNormal>        #    return(synth(503, "No backends available"));<o:p></o:p></p><p class=MsoNormal>       #}<o:p></o:p></p><p class=MsoNormal>    } else {<o:p></o:p></p><p class=MsoNormal>       return(synth(403, "Access denied."));<o:p></o:p></p><p class=MsoNormal>   }<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    include "/etc/varnish/vhost.vcl";<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Remove the proxy header (see https://httpoxy.org/#mitigate-varnish)<o:p></o:p></p><p class=MsoNormal>  unset req.http.proxy;<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Allow purging<o:p></o:p></p><p class=MsoNormal>  if (req.method == "PURGE") {<o:p></o:p></p><p class=MsoNormal>    if (!client.ip ~ purge) { # purge is the ACL defined at the begining<o:p></o:p></p><p class=MsoNormal>      # Not from an allowed IP? Then die with an error.<o:p></o:p></p><p class=MsoNormal>      return (synth(405, "IP: " + client.ip  +  " is not allowed to send PURGE requests."));<o:p></o:p></p><p class=MsoNormal>    }<o:p></o:p></p><p class=MsoNormal>    # If you got this stage (and didn't error out above), purge the cached result<o:p></o:p></p><p class=MsoNormal>    return (purge);<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Only allow BAN requests from IP addresses in the 'purge' ACL.<o:p></o:p></p><p class=MsoNormal>  if (req.method == "BAN") {<o:p></o:p></p><p class=MsoNormal>      # Same ACL check as above:<o:p></o:p></p><p class=MsoNormal>      if (!client.ip ~ purge) {<o:p></o:p></p><p class=MsoNormal>                return (synth(405, "IP: " + client.ip  +  " is not allowed to send BAN requests."));<o:p></o:p></p><p class=MsoNormal>      }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>      # manual sudo varnishadm "ban req.http.host ~ www.mydomain.com"<o:p></o:p></p><p class=MsoNormal>      ban("req.http.host ~ " + req.http.host);<o:p></o:p></p><p class=MsoNormal>      # Throw a synthetic page so the request won't go to the backend.<o:p></o:p></p><p class=MsoNormal>      return (synth(200, "BAN for " + req.http.host + " done"));<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Only cache GET or HEAD requests. This makes sure the POST requests are always passed.<o:p></o:p></p><p class=MsoNormal>  if (req.method != "GET" && req.method != "HEAD") {<o:p></o:p></p><p class=MsoNormal>    return (pass);<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Some generic URL manipulation, useful for all templates that follow<o:p></o:p></p><p class=MsoNormal>  # First remove the Google Analytics added parameters, useless for our backend<o:p></o:p></p><p class=MsoNormal>  if (req.url ~ "(\?|&)(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=") {<o:p></o:p></p><p class=MsoNormal>    set req.url = regsuball(req.url, "&(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", "");<o:p></o:p></p><p class=MsoNormal>    set req.url = regsuball(req.url, "\?(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", "?");<o:p></o:p></p><p class=MsoNormal>    set req.url = regsub(req.url, "\?&", "?");<o:p></o:p></p><p class=MsoNormal>    set req.url = regsub(req.url, "\?$", "");<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Strip hash, server doesn't need it.<o:p></o:p></p><p class=MsoNormal>  if (req.url ~ "\#") {<o:p></o:p></p><p class=MsoNormal>    set req.url = regsub(req.url, "\#.*$", "");<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Strip a trailing ? if it exists<o:p></o:p></p><p class=MsoNormal>  if (req.url ~ "\?$") {<o:p></o:p></p><p class=MsoNormal>    set req.url = regsub(req.url, "\?$", "");<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Some generic cookie manipulation, useful for all templates that follow<o:p></o:p></p><p class=MsoNormal>  # Remove the "has_js" cookie<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Remove any Google Analytics based cookies<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "_ga=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "_gat=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "utmctr=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "utmcmd.=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "utmccn.=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Remove DoubleClick offensive cookies<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "__gads=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Remove the Quant Capital cookies (added by some plugin, all __qca)<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Remove the AddThis cookies<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "__atuv.=[^;]+(; )?", "");<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Remove a ";" prefix in the cookie if present<o:p></o:p></p><p class=MsoNormal>  set req.http.Cookie = regsuball(req.http.Cookie, "^;\s*", "");<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Are there cookies left with only spaces or that are empty?<o:p></o:p></p><p class=MsoNormal>  if (req.http.cookie ~ "^\s*$") {<o:p></o:p></p><p class=MsoNormal>    unset req.http.cookie;<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Large static files are delivered directly to the end-user without<o:p></o:p></p><p class=MsoNormal>  # waiting for Varnish to fully read the file first.<o:p></o:p></p><p class=MsoNormal>  # Varnish 4 fully supports Streaming, so set do_stream in vcl_backend_response()<o:p></o:p></p><p class=MsoNormal>  if (req.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") {<o:p></o:p></p><p class=MsoNormal>    unset req.http.Cookie;<o:p></o:p></p><p class=MsoNormal>    return (hash);<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  #Remove all cookies for static files<o:p></o:p></p><p class=MsoNormal>  if (req.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") {<o:p></o:p></p><p class=MsoNormal>    unset req.http.Cookie;<o:p></o:p></p><p class=MsoNormal>    return (hash);<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Send Surrogate-Capability headers to announce ESI support to backend<o:p></o:p></p><p class=MsoNormal>  set req.http.Surrogate-Capability = "key=ESI/1.0";<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  if (req.http.Authorization) {<o:p></o:p></p><p class=MsoNormal>    # Not cacheable by default<o:p></o:p></p><p class=MsoNormal>    return (pass);<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> if (req.url == "/checksite.aspx") {<o:p></o:p></p><p class=MsoNormal>    # Dont cache monitoring url<o:p></o:p></p><p class=MsoNormal>    return (pass);<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal> return (hash);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>sub vcl_backend_response {<o:p></o:p></p><p class=MsoNormal>    # Happens after we have read the response headers from the backend.<o:p></o:p></p><p class=MsoNormal>    #<o:p></o:p></p><p class=MsoNormal>    # Here you clean the response headers, removing silly Set-Cookie headers<o:p></o:p></p><p class=MsoNormal>    # and other mistakes your backend does.<o:p></o:p></p><p class=MsoNormal>    #<o:p></o:p></p><p class=MsoNormal>    #<o:p></o:p></p><p class=MsoNormal>    set beresp.http.X-Backend = beresp.backend.name;<o:p></o:p></p><p class=MsoNormal>    # Remove some headers: ASP version<o:p></o:p></p><p class=MsoNormal>    unset beresp.http.X-Powered-By;<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    # Remove cookie with empty basketid useless... VL should fix on backend<o:p></o:p></p><p class=MsoNormal>    if (beresp.http.set-cookie == "BasketID=; path=/") {<o:p></o:p></p><p class=MsoNormal>      unset beresp.http.set-cookie;<o:p></o:p></p><p class=MsoNormal>    }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Pause ESI request and remove Surrogate-Control header<o:p></o:p></p><p class=MsoNormal>  if (beresp.http.Surrogate-Control ~ "ESI/1.0") {<o:p></o:p></p><p class=MsoNormal>    unset beresp.http.Surrogate-Control;<o:p></o:p></p><p class=MsoNormal>    set beresp.do_esi = true;<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Enable cache for all static files<o:p></o:p></p><p class=MsoNormal>  # The same argument as the static caches from above: monitor your cache size, if you get data nuked out of it, consider giving up the static file cache.<o:p></o:p></p><p class=MsoNormal>  # Before you blindly enable this, have a read here: https://ma.ttias.be/stop-caching-static-files/<o:p></o:p></p><p class=MsoNormal>  if (bereq.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") {<o:p></o:p></p><p class=MsoNormal>    unset beresp.http.set-cookie;<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Large static files are delivered directly to the end-user without<o:p></o:p></p><p class=MsoNormal>  # waiting for Varnish to fully read the file first.<o:p></o:p></p><p class=MsoNormal>  # Varnish 4 fully supports Streaming, so use streaming here to avoid locking.<o:p></o:p></p><p class=MsoNormal>  if (bereq.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") {<o:p></o:p></p><p class=MsoNormal>    unset beresp.http.set-cookie;<o:p></o:p></p><p class=MsoNormal>    set beresp.do_stream = true;  # Check memory usage it'll grow in fetch_chunksize blocks (128k by default) if the backend doesn't send a Content-Length header, so only enable it for big objects<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Don't cache 50x responses<o:p></o:p></p><p class=MsoNormal>  if (beresp.status == 500 || beresp.status == 502 || beresp.status == 503 || beresp.status == 504) {<o:p></o:p></p><p class=MsoNormal>    return (abandon);<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    if (bereq.http.Cookie ~ "(UserID|_session)") {<o:p></o:p></p><p class=MsoNormal>        #set beresp.http.X-Cacheable = "NO:Got Session";<o:p></o:p></p><p class=MsoNormal>        set beresp.uncacheable = true;<o:p></o:p></p><p class=MsoNormal>        return (deliver);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    } elsif (beresp.ttl <= 0s) {<o:p></o:p></p><p class=MsoNormal>        # Varnish determined the object was not cacheable<o:p></o:p></p><p class=MsoNormal>        #set beresp.http.X-Cacheable = "NO:Not Cacheable";<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    } elsif (beresp.http.set-cookie) {<o:p></o:p></p><p class=MsoNormal>        # You don't wish to cache content for logged in users<o:p></o:p></p><p class=MsoNormal>        #set beresp.http.X-Cacheable = "NO:Set-Cookie";<o:p></o:p></p><p class=MsoNormal>        set beresp.uncacheable = true;<o:p></o:p></p><p class=MsoNormal>        return (deliver);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    } elsif (beresp.http.Cache-Control ~ "private") {<o:p></o:p></p><p class=MsoNormal>        # You are respecting the Cache-Control=private header from the backend<o:p></o:p></p><p class=MsoNormal>        #set beresp.http.X-Cacheable = "NO:Cache-Control=private";<o:p></o:p></p><p class=MsoNormal>        set beresp.uncacheable = true;<o:p></o:p></p><p class=MsoNormal>        return (deliver);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    } else {<o:p></o:p></p><p class=MsoNormal>        # Varnish determined the object was cacheable<o:p></o:p></p><p class=MsoNormal>        #set beresp.http.X-Cacheable = "YES";<o:p></o:p></p><p class=MsoNormal>    }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    return(deliver);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>sub vcl_deliver {<o:p></o:p></p><p class=MsoNormal>    # Happens when we have all the pieces we need, and are about to send the<o:p></o:p></p><p class=MsoNormal>    # response to the client.<o:p></o:p></p><p class=MsoNormal>    #<o:p></o:p></p><p class=MsoNormal>    # You can do accounting or modifying the final object here.<o:p></o:p></p><p class=MsoNormal>  if (obj.hits > 0) { # Add debug header to see if it's a HIT/MISS and the number of hits, disable when not needed<o:p></o:p></p><p class=MsoNormal>    set resp.http.X-Cache = "HIT";<o:p></o:p></p><p class=MsoNormal>  } else {<o:p></o:p></p><p class=MsoNormal>    set resp.http.X-Cache = "MISS";<o:p></o:p></p><p class=MsoNormal>  }<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Unset some headers<o:p></o:p></p><p class=MsoNormal>  unset resp.http.Via;<o:p></o:p></p><p class=MsoNormal>  unset resp.http.X-Varnish;<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  # Please note that obj.hits behaviour changed in 4.0, now it counts per objecthead, not per object<o:p></o:p></p><p class=MsoNormal>  # and obj.hits may not be reset in some cases where bans are in use. See bug 1492 for details.<o:p></o:p></p><p class=MsoNormal>  # So take hits with a grain of salt<o:p></o:p></p><p class=MsoNormal>  set resp.http.X-Cache-Hits = obj.hits;<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal>Cris<o:p></o:p></p></div></body></html>