<div dir="ltr">Hello,<div><br></div><div>Aside from the provided VCL being for WordPress, while you're running XenForo, the xf_ cookies are being dropped by your config. A quick fix is:</div><div><br></div><div><div>sub vcl_recv {</div><div> if( req.http.Cookie ~ "xf_(session|user)") {</div><div> return (pass);</div><div> }</div><div>}</div><div><br></div><div>sub vcl_backend_response {</div><div> if (req.http.Cookie ~ "xf_(session|user)") {</div><div> set beresp.uncacheable = true;</div><div> set beresp.ttl = 1w;</div><div> return (deliver);</div><div> }</div><div>}</div></div><div><br></div><div>However, I suggest auditing your VCL, and only including rules specific to the application(s) which you are running.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 4, 2016 at 8:09 AM, Ayberk Kimsesiz <span dir="ltr"><<a href="mailto:ayberk.kimsesiz@gmail.com" target="_blank">ayberk.kimsesiz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Users can't login or register to <a href="http://domain.com/forum" target="_blank">domain.com/forum</a> with the current settings. So we need to make a change related to <i>xf_user </i>and <i>xf_session</i> but how?<div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-08-04 15:26 GMT+03:00 Lane, Richard <span dir="ltr"><<a href="mailto:rlane@ahbelo.com" target="_blank">rlane@ahbelo.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>If you want Varnish to ignore request for a path you need to tell it to pass. In your example you have a rule for the RSS feed. You can do the same for /forum/ in your vcl_recv block.</div><div><br></div><div>*# DO NOT CACHE RSS FEED*<br>* if (req.url ~ "/feed(/)?") {*<br>* return ( pass ); *<br>*}*<br></div><div><br></div><div>*# DO NOT CACHE FORUM*<br> if (req.url ~ "/forum(/)?") {<br> return ( pass ); <br> }<br></div><div><br></div><div>Cheers,</div><div>Richard</div><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
<br>
Message: 1<br>
Date: Wed, 3 Aug 2016 23:34:40 +0300<br>
From: Ayberk Kimsesiz <<a href="mailto:ayberk.kimsesiz@gmail.com" target="_blank">ayberk.kimsesiz@gmail.com</a>><br>
To: varnish-misc <<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.or<wbr>g</a>><br>
Subject: XenForo default.vcl settings<br>
Message-ID:<br>
<<a href="mailto:CAPQGzE29n1QOmHarn9L-9ztquGfeu-AwNJUaDrHm_w-5BXmA_Q@mail.gmail.com" target="_blank">CAPQGzE29n1QOmHarn9L-9ztquGfe<wbr>u-AwNJUaDrHm_w-5BXmA_Q@mail.gm<wbr>ail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi,<br>
<br>
Could you please share the appropriate Default.vcl settings for XenForo<br>
Forums? No one can register to the forum at the moment. My current<br>
Default.vcl settings are as follows.<br>
<br>
Forum address: <a href="http://domain.com/forum" rel="noreferrer" target="_blank">domain.com/forum</a><br>
<br>
*/* SET THE HOST AND PORT OF WORDPRESS*<br>
* * ******************************<wbr>***************************/*<br>
*vcl 4.0;*<br>
*import std;*<br>
<br>
*backend default {*<br>
* .host = "*******";*<br>
* .port = "8080";*<br>
* .connect_timeout = 600s;*<br>
* .first_byte_timeout = 600s;*<br>
* .between_bytes_timeout = 600s;*<br>
* .max_connections = 800;*<br>
*}*<br>
<br>
*# SET THE ALLOWED IP OF PURGE REQUESTS*<br>
*# ##############################<wbr>############################*<br>
*acl purge {*<br>
* "localhost";*<br>
* "127.0.0.1";*<br>
*}*<br>
<br>
*#THE RECV FUNCTION*<br>
*# ##############################<wbr>############################*<br>
*sub vcl_recv {*<br>
<br>
*# set realIP by trimming CloudFlare IP which will be used for various<br>
checks*<br>
*set req.http.X-Actual-IP = regsub(req.http.X-Forwarded-Fo<wbr>r, "[, ].*$",<br>
""); *<br>
<br>
* # FORWARD THE IP OF THE REQUEST*<br>
* if (req.restarts == 0) {*<br>
* if (req.http.x-forwarded-for) {*<br>
* set req.http.X-Forwarded-For =*<br>
* req.http.X-Forwarded-For + ", " + client.ip;*<br>
* } else {*<br>
* set req.http.X-Forwarded-For = client.ip;*<br>
* }*<br>
* }*<br>
<br>
* # Purge request check sections for hash_always_miss, purge and ban*<br>
* # BLOCK IF NOT IP is not in purge acl*<br>
* # ##############################<wbr>############################*<br>
<br>
* # Enable smart refreshing using hash_always_miss*<br>
*if (req.http.Cache-Control ~ "no-cache") {*<br>
* if (client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4") ~<br>
purge) {*<br>
* set req.hash_always_miss = true;*<br>
* }*<br>
*}*<br>
<br>
*if (req.method == "PURGE") {*<br>
* if (!client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4") ~<br>
purge) {*<br>
* return(synth(405,"Not allowed."));*<br>
* }*<br>
* return (purge);*<br>
<br>
* }*<br>
*if (req.method == "BAN") {*<br>
* # Same ACL check as above:*<br>
* if (!client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4")<br>
~ purge) {*<br>
* return(synth(403, "Not allowed."));*<br>
* }*<br>
* ban("req.http.host == " + req.http.host +*<br>
* " && req.url == " + req.url);*<br>
<br>
* # Throw a synthetic page so the*<br>
* # request won't go to the backend.*<br>
* return(synth(200, "Ban added"));*<br>
*}*<br>
<br>
<br>
*# Unset cloudflare cookies*<br>
*# Remove has_js and CloudFlare/Google Analytics __* cookies.*<br>
* set req.http.Cookie = regsuball(req.http.Cookie,<br>
"(^|;\s*)(_[_a-z]+|has_js)=[^;<wbr>]*", "");*<br>
* # Remove a ";" prefix, if present.*<br>
* set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");*<br>
<br>
* # For Testing: If you want to test with Varnish passing (not caching)<br>
uncomment*<br>
* # return( pass );*<br>
<br>
* # FORWARD THE IP OF THE REQUEST*<br>
* if (req.restarts == 0) {*<br>
* if (req.http.x-forwarded-for) {*<br>
* set req.http.X-Forwarded-For =*<br>
* req.http.X-Forwarded-For + ", " + client.ip;*<br>
* } else {*<br>
* set req.http.X-Forwarded-For = client.ip;*<br>
* }*<br>
* }*<br>
<br>
*# DO NOT CACHE RSS FEED*<br>
* if (req.url ~ "/feed(/)?") {*<br>
* return ( pass ); *<br>
*}*<br>
<br>
*## Do not cache search results, comment these 3 lines if you do want to<br>
cache them*<br>
<br>
*if (req.url ~ "/\?s\=") {*<br>
* return ( pass ); *<br>
*}*<br>
<br>
*# CLEAN UP THE ENCODING HEADER.*<br>
* # SET TO GZIP, DEFLATE, OR REMOVE ENTIRELY. WITH VARY ACCEPT-ENCODING*<br>
* # VARNISH WILL CREATE SEPARATE CACHES FOR EACH*<br>
* # DO NOT ACCEPT-ENCODING IMAGES, ZIPPED FILES, AUDIO, ETC.*<br>
* # ##############################<wbr>############################*<br>
* if (req.http.Accept-Encoding) {*<br>
* if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz<wbr>|mp3|ogg)$") {*<br>
* # No point in compressing these*<br>
* unset req.http.Accept-Encoding;*<br>
* } elsif (req.http.Accept-Encoding ~ "gzip") {*<br>
* set req.http.Accept-Encoding = "gzip";*<br>
* } elsif (req.http.Accept-Encoding ~ "deflate") {*<br>
* set req.http.Accept-Encoding = "deflate";*<br>
* } else {*<br>
* # unknown algorithm*<br>
* unset req.http.Accept-Encoding;*<br>
* }*<br>
* }*<br>
<br>
* # PIPE ALL NON-STANDARD REQUESTS*<br>
* # ##############################<wbr>############################*<br>
* if (req.method != "GET" &&*<br>
* req.method != "HEAD" &&*<br>
* req.method != "PUT" && *<br>
* req.method != "POST" &&*<br>
* req.method != "TRACE" &&*<br>
* req.method != "OPTIONS" &&*<br>
* req.method != "DELETE") {*<br>
* return (pipe);*<br>
* }*<br>
<br>
* # ONLY CACHE GET AND HEAD REQUESTS*<br>
* # ##############################<wbr>############################*<br>
* if (req.method != "GET" && req.method != "HEAD") {*<br>
* return (pass);*<br>
* }*<br>
<br>
* # OPTIONAL: DO NOT CACHE LOGGED IN USERS (THIS OCCURS IN FETCH TOO,<br>
EITHER*<br>
* # COMMENT OR UNCOMMENT BOTH*<br>
* # ##############################<wbr>############################*<br>
* if ( req.http.cookie ~ "wordpress_logged_in" ) {*<br>
* return( pass );*<br>
* }*<br>
<br>
* # IF THE REQUEST IS NOT FOR A PREVIEW, WP-ADMIN OR WP-LOGIN*<br>
* # THEN UNSET THE COOKIES*<br>
* # ##############################<wbr>############################*<br>
* if (!(req.url ~ "wp-(login|admin)") *<br>
* && !(req.url ~ "&preview=true" ) *<br>
* ){*<br>
* unset req.http.cookie;*<br>
* }*<br>
<br>
* # IF BASIC AUTH IS ON THEN DO NOT CACHE*<br>
* # ##############################<wbr>############################*<br>
* if (req.http.Authorization || req.http.Cookie) {*<br>
* return (pass);*<br>
* }*<br>
<br>
* # IF YOU GET HERE THEN THIS REQUEST SHOULD BE CACHED*<br>
* # ##############################<wbr>############################*<br>
* return (hash);*<br>
* # This is for phpmyadmin*<br>
*if (req.http.Host == "<a href="http://ki1.org" rel="noreferrer" target="_blank">ki1.org</a> <<a href="http://ki1.org" rel="noreferrer" target="_blank">http://ki1.org</a>>") {*<br>
*return (pass);*<br>
*}*<br>
<br>
*if (req.http.Host == "<a href="http://mysql.ki1.org" rel="noreferrer" target="_blank">mysql.ki1.org</a> <<a href="http://mysql.ki1.org" rel="noreferrer" target="_blank">http://mysql.ki1.org</a>>") {*<br>
*return (pass);*<br>
*}*<br>
<br>
*}*<br>
<br>
*# HIT FUNCTION*<br>
*# ##############################<wbr>############################*<br>
*sub vcl_hit {*<br>
* # IF THIS IS A PURGE REQUEST THEN DO THE PURGE*<br>
* # ##############################<wbr>############################*<br>
* if (req.method == "PURGE") {*<br>
* #*<br>
* # This is now handled in vcl_recv.*<br>
* #*<br>
* # purge;*<br>
* return (synth(200, "Purged."));*<br>
* }*<br>
* return (deliver);*<br>
*}*<br>
<br>
*# MISS FUNCTION*<br>
*# ##############################<wbr>############################*<br>
*sub vcl_miss {*<br>
* if (req.method == "PURGE") {*<br>
* #*<br>
* # This is now handled in vcl_recv.*<br>
* #*<br>
* # purge;*<br>
* return (synth(200, "Purged."));*<br>
* }*<br>
* return (fetch);*<br>
*}*<br>
<br>
*# FETCH FUNCTION*<br>
*# ##############################<wbr>############################*<br>
*sub vcl_backend_response {*<br>
* # I SET THE VARY TO ACCEPT-ENCODING, THIS OVERRIDES W3TC *<br>
* # TENDANCY TO SET VARY USER-AGENT. YOU MAY OR MAY NOT WANT*<br>
* # TO DO THIS*<br>
* # ##############################<wbr>############################*<br>
* set beresp.http.Vary = "Accept-Encoding";*<br>
<br>
* # IF NOT WP-ADMIN THEN UNSET COOKIES AND SET THE AMOUNT OF *<br>
* # TIME THIS PAGE WILL STAY CACHED (TTL)*<br>
* # ##############################<wbr>############################*<br>
* if (!(bereq.url ~ "wp-(login|admin)") && !bereq.http.cookie ~<br>
"wordpress_logged_in" ) {*<br>
* unset beresp.http.set-cookie;*<br>
* set beresp.ttl = 52w;*<br>
*# set beresp.grace =1w;*<br>
* }*<br>
<br>
* if (beresp.ttl <= 0s ||*<br>
* beresp.http.Set-Cookie ||*<br>
* beresp.http.Vary == "*") {*<br>
* set beresp.ttl = 120 s;*<br>
* # set beresp.ttl = 120s;*<br>
* set beresp.uncacheable = true;*<br>
* return (deliver);*<br>
* }*<br>
<br>
* return (deliver);*<br>
*}*<br>
<br>
*# DELIVER FUNCTION*<br>
*# ##############################<wbr>############################*<br>
*sub vcl_deliver {*<br>
* # IF THIS PAGE IS ALREADY CACHED THEN RETURN A 'HIT' TEXT *<br>
* # IN THE HEADER (GREAT FOR DEBUGGING)*<br>
* # ##############################<wbr>############################*<br>
* if (obj.hits > 0) {*<br>
* set resp.http.X-Cache = "HIT";*<br>
* # IF THIS IS A MISS RETURN THAT IN THE HEADER*<br>
* # ##############################<wbr>############################*<br>
* } else {*<br>
* set resp.http.X-Cache = "MISS";*<br>
* }*<br>
*}*<br>
<br>
<br>
Thanks,<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160803/d572e4b2/attachment-0001.html" rel="noreferrer" target="_blank">https://www.varnish-cache.org<wbr>/lists/pipermail/varnish-misc/<wbr>attachments/20160803/d572e4b2/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 4 Aug 2016 12:14:36 +0300<br>
From: Ayberk Kimsesiz <<a href="mailto:ayberk.kimsesiz@gmail.com" target="_blank">ayberk.kimsesiz@gmail.com</a>><br>
To: varnish-misc <<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.or<wbr>g</a>><br>
Subject: Re: XenForo default.vcl settings<br>
Message-ID:<br>
<<a href="mailto:CAPQGzE39XkXy_44z5oUXBO5q5sF5CvQmNP5k771DPi4O3i1ofA@mail.gmail.com" target="_blank">CAPQGzE39XkXy_44z5oUXBO5q5sF5<wbr>CvQmNP5k771DPi4O3i1ofA@mail.gm<wbr>ail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I need to add the followings to default.vcl for Xenforo. However, solutions<br>
in the Xenforo forums for this didn't work. Can you please help?<br>
<br>
xf_session_admin<br>
xf_user<br>
xf_session<br>
<br>
Or how can i block Varnish in a way that it doesn't work in *<a href="http://domain.com/forum" rel="noreferrer" target="_blank">domain.com/forum</a><br>
<<a href="http://domain.com/forum" rel="noreferrer" target="_blank">http://domain.com/forum</a>>*<br>
<br>
<br>
<br>
2016-08-03 23:34 GMT+03:00 Ayberk Kimsesiz <<a href="mailto:ayberk.kimsesiz@gmail.com" target="_blank">ayberk.kimsesiz@gmail.com</a>>:<br>
<br>
> Hi,<br>
><br>
> Could you please share the appropriate Default.vcl settings for XenForo<br>
> Forums? No one can register to the forum at the moment. My current<br>
> Default.vcl settings are as follows.<br>
><br>
> Forum address: <a href="http://domain.com/forum" rel="noreferrer" target="_blank">domain.com/forum</a><br>
><br>
> */* SET THE HOST AND PORT OF WORDPRESS*<br>
> * * ******************************<wbr>***************************/*<br>
> *vcl 4.0;*<br>
> *import std;*<br>
><br>
> *backend default {*<br>
> * .host = "*******";*<br>
> * .port = "8080";*<br>
> * .connect_timeout = 600s;*<br>
> * .first_byte_timeout = 600s;*<br>
> * .between_bytes_timeout = 600s;*<br>
> * .max_connections = 800;*<br>
> *}*<br>
><br>
> *# SET THE ALLOWED IP OF PURGE REQUESTS*<br>
> *# ##############################<wbr>############################*<br>
> *acl purge {*<br>
> * "localhost";*<br>
> * "127.0.0.1";*<br>
> *}*<br>
><br>
> *#THE RECV FUNCTION*<br>
> *# ##############################<wbr>############################*<br>
> *sub vcl_recv {*<br>
><br>
> *# set realIP by trimming CloudFlare IP which will be used for various<br>
> checks*<br>
> *set req.http.X-Actual-IP = regsub(req.http.X-Forwarded-Fo<wbr>r, "[, ].*$",<br>
> ""); *<br>
><br>
> * # FORWARD THE IP OF THE REQUEST*<br>
> * if (req.restarts == 0) {*<br>
> * if (req.http.x-forwarded-for) {*<br>
> * set req.http.X-Forwarded-For =*<br>
> * req.http.X-Forwarded-For + ", " + client.ip;*<br>
> * } else {*<br>
> * set req.http.X-Forwarded-For = client.ip;*<br>
> * }*<br>
> * }*<br>
><br>
> * # Purge request check sections for hash_always_miss, purge and ban*<br>
> * # BLOCK IF NOT IP is not in purge acl*<br>
> * # ##############################<wbr>############################*<br>
><br>
> * # Enable smart refreshing using hash_always_miss*<br>
> *if (req.http.Cache-Control ~ "no-cache") {*<br>
> * if (client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4") ~<br>
> purge) {*<br>
> * set req.hash_always_miss = true;*<br>
> * }*<br>
> *}*<br>
><br>
> *if (req.method == "PURGE") {*<br>
> * if (!client.ip ~ purge || !std.ip(req.http.X-Actual-IP, "1.2.3.4") ~<br>
> purge) {*<br>
> * return(synth(405,"Not allowed."));*<br>
> * }*<br>
> * return (purge);*<br>
><br>
> * }*<br>
> *if (req.method == "BAN") {*<br>
> * # Same ACL check as above:*<br>
> * if (!client.ip ~ purge || !std.ip(req.http.X-Actual-IP,<br>
> "1.2.3.4") ~ purge) {*<br>
> * return(synth(403, "Not allowed."));*<br>
> * }*<br>
> * ban("req.http.host == " + req.http.host +*<br>
> * " && req.url == " + req.url);*<br>
><br>
> * # Throw a synthetic page so the*<br>
> * # request won't go to the backend.*<br>
> * return(synth(200, "Ban added"));*<br>
> *}*<br>
><br>
><br>
> *# Unset cloudflare cookies*<br>
> *# Remove has_js and CloudFlare/Google Analytics __* cookies.*<br>
> * set req.http.Cookie = regsuball(req.http.Cookie,<br>
> "(^|;\s*)(_[_a-z]+|has_js)=[^;<wbr>]*", "");*<br>
> * # Remove a ";" prefix, if present.*<br>
> * set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");*<br>
><br>
> * # For Testing: If you want to test with Varnish passing (not caching)<br>
> uncomment*<br>
> * # return( pass );*<br>
><br>
> * # FORWARD THE IP OF THE REQUEST*<br>
> * if (req.restarts == 0) {*<br>
> * if (req.http.x-forwarded-for) {*<br>
> * set req.http.X-Forwarded-For =*<br>
> * req.http.X-Forwarded-For + ", " + client.ip;*<br>
> * } else {*<br>
> * set req.http.X-Forwarded-For = client.ip;*<br>
> * }*<br>
> * }*<br>
><br>
> *# DO NOT CACHE RSS FEED*<br>
> * if (req.url ~ "/feed(/)?") {*<br>
> * return ( pass ); *<br>
> *}*<br>
><br>
> *## Do not cache search results, comment these 3 lines if you do want to<br>
> cache them*<br>
><br>
> *if (req.url ~ "/\?s\=") {*<br>
> * return ( pass ); *<br>
> *}*<br>
><br>
> *# CLEAN UP THE ENCODING HEADER.*<br>
> * # SET TO GZIP, DEFLATE, OR REMOVE ENTIRELY. WITH VARY ACCEPT-ENCODING*<br>
> * # VARNISH WILL CREATE SEPARATE CACHES FOR EACH*<br>
> * # DO NOT ACCEPT-ENCODING IMAGES, ZIPPED FILES, AUDIO, ETC.*<br>
> * # ##############################<wbr>############################*<br>
> * if (req.http.Accept-Encoding) {*<br>
> * if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz<wbr>|mp3|ogg)$") {*<br>
> * # No point in compressing these*<br>
> * unset req.http.Accept-Encoding;*<br>
> * } elsif (req.http.Accept-Encoding ~ "gzip") {*<br>
> * set req.http.Accept-Encoding = "gzip";*<br>
> * } elsif (req.http.Accept-Encoding ~ "deflate") {*<br>
> * set req.http.Accept-Encoding = "deflate";*<br>
> * } else {*<br>
> * # unknown algorithm*<br>
> * unset req.http.Accept-Encoding;*<br>
> * }*<br>
> * }*<br>
><br>
> * # PIPE ALL NON-STANDARD REQUESTS*<br>
> * # ##############################<wbr>############################*<br>
> * if (req.method != "GET" &&*<br>
> * req.method != "HEAD" &&*<br>
> * req.method != "PUT" && *<br>
> * req.method != "POST" &&*<br>
> * req.method != "TRACE" &&*<br>
> * req.method != "OPTIONS" &&*<br>
> * req.method != "DELETE") {*<br>
> * return (pipe);*<br>
> * }*<br>
><br>
> * # ONLY CACHE GET AND HEAD REQUESTS*<br>
> * # ##############################<wbr>############################*<br>
> * if (req.method != "GET" && req.method != "HEAD") {*<br>
> * return (pass);*<br>
> * }*<br>
><br>
> * # OPTIONAL: DO NOT CACHE LOGGED IN USERS (THIS OCCURS IN FETCH TOO,<br>
> EITHER*<br>
> * # COMMENT OR UNCOMMENT BOTH*<br>
> * # ##############################<wbr>############################*<br>
> * if ( req.http.cookie ~ "wordpress_logged_in" ) {*<br>
> * return( pass );*<br>
> * }*<br>
><br>
> * # IF THE REQUEST IS NOT FOR A PREVIEW, WP-ADMIN OR WP-LOGIN*<br>
> * # THEN UNSET THE COOKIES*<br>
> * # ##############################<wbr>############################*<br>
> * if (!(req.url ~ "wp-(login|admin)") *<br>
> * && !(req.url ~ "&preview=true" ) *<br>
> * ){*<br>
> * unset req.http.cookie;*<br>
> * }*<br>
><br>
> * # IF BASIC AUTH IS ON THEN DO NOT CACHE*<br>
> * # ##############################<wbr>############################*<br>
> * if (req.http.Authorization || req.http.Cookie) {*<br>
> * return (pass);*<br>
> * }*<br>
><br>
> * # IF YOU GET HERE THEN THIS REQUEST SHOULD BE CACHED*<br>
> * # ##############################<wbr>############################*<br>
> * return (hash);*<br>
> * # This is for phpmyadmin*<br>
> *if (req.http.Host == "<a href="http://ki1.org" rel="noreferrer" target="_blank">ki1.org</a> <<a href="http://ki1.org" rel="noreferrer" target="_blank">http://ki1.org</a>>") {*<br>
> *return (pass);*<br>
> *}*<br>
><br>
> *if (req.http.Host == "<a href="http://mysql.ki1.org" rel="noreferrer" target="_blank">mysql.ki1.org</a> <<a href="http://mysql.ki1.org" rel="noreferrer" target="_blank">http://mysql.ki1.org</a>>") {*<br>
> *return (pass);*<br>
> *}*<br>
><br>
> *}*<br>
><br>
> *# HIT FUNCTION*<br>
> *# ##############################<wbr>############################*<br>
> *sub vcl_hit {*<br>
> * # IF THIS IS A PURGE REQUEST THEN DO THE PURGE*<br>
> * # ##############################<wbr>############################*<br>
> * if (req.method == "PURGE") {*<br>
> * #*<br>
> * # This is now handled in vcl_recv.*<br>
> * #*<br>
> * # purge;*<br>
> * return (synth(200, "Purged."));*<br>
> * }*<br>
> * return (deliver);*<br>
> *}*<br>
><br>
> *# MISS FUNCTION*<br>
> *# ##############################<wbr>############################*<br>
> *sub vcl_miss {*<br>
> * if (req.method == "PURGE") {*<br>
> * #*<br>
> * # This is now handled in vcl_recv.*<br>
> * #*<br>
> * # purge;*<br>
> * return (synth(200, "Purged."));*<br>
> * }*<br>
> * return (fetch);*<br>
> *}*<br>
><br>
> *# FETCH FUNCTION*<br>
> *# ##############################<wbr>############################*<br>
> *sub vcl_backend_response {*<br>
> * # I SET THE VARY TO ACCEPT-ENCODING, THIS OVERRIDES W3TC *<br>
> * # TENDANCY TO SET VARY USER-AGENT. YOU MAY OR MAY NOT WANT*<br>
> * # TO DO THIS*<br>
> * # ##############################<wbr>############################*<br>
> * set beresp.http.Vary = "Accept-Encoding";*<br>
><br>
> * # IF NOT WP-ADMIN THEN UNSET COOKIES AND SET THE AMOUNT OF *<br>
> * # TIME THIS PAGE WILL STAY CACHED (TTL)*<br>
> * # ##############################<wbr>############################*<br>
> * if (!(bereq.url ~ "wp-(login|admin)") && !bereq.http.cookie ~<br>
> "wordpress_logged_in" ) {*<br>
> * unset beresp.http.set-cookie;*<br>
> * set beresp.ttl = 52w;*<br>
> *# set beresp.grace =1w;*<br>
> * }*<br>
><br>
> * if (beresp.ttl <= 0s ||*<br>
> * beresp.http.Set-Cookie ||*<br>
> * beresp.http.Vary == "*") {*<br>
> * set beresp.ttl = 120 s;*<br>
> * # set beresp.ttl = 120s;*<br>
> * set beresp.uncacheable = true;*<br>
> * return (deliver);*<br>
> * }*<br>
><br>
> * return (deliver);*<br>
> *}*<br>
><br>
> *# DELIVER FUNCTION*<br>
> *# ##############################<wbr>############################*<br>
> *sub vcl_deliver {*<br>
> * # IF THIS PAGE IS ALREADY CACHED THEN RETURN A 'HIT' TEXT *<br>
> * # IN THE HEADER (GREAT FOR DEBUGGING)*<br>
> * # ##############################<wbr>############################*<br>
> * if (obj.hits > 0) {*<br>
> * set resp.http.X-Cache = "HIT";*<br>
> * # IF THIS IS A MISS RETURN THAT IN THE HEADER*<br>
> * # ##############################<wbr>############################*<br>
> * } else {*<br>
> * set resp.http.X-Cache = "MISS";*<br>
> * }*<br>
> *}*<br>
><br>
><br>
> Thanks,<br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160804/4e3f064a/attachment.html" rel="noreferrer" target="_blank">https://www.varnish-cache.org<wbr>/lists/pipermail/varnish-misc/<wbr>attachments/20160804/4e3f064a/<wbr>attachment.html</a>><br>
<br>
------------------------------<br>
<br>
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/varnish<wbr>-misc</a><br>
<br>
End of varnish-misc Digest, Vol 125, Issue 14<br>
******************************<wbr>***************<br>
</blockquote></div><br></div></div>
<br>______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/varnish<wbr>-misc</a><br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br></blockquote></div><br></div>