<div dir="ltr"><br style="color:rgb(0,0,0);font-family:verdana,arial,helvetica,sans-serif;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:verdana,arial,helvetica,sans-serif;font-size:13.3333px">- ban("req.url ~ " + req.url + " &amp;&amp; req.http.host ~ " + req.http.host);</span><br><div><br style="color:rgb(0,0,0);font-family:verdana,arial,helvetica,sans-serif;font-size:13.3333px"><span style="color:rgb(0,0,0);font-family:verdana,arial,helvetica,sans-serif;font-size:13.3333px">+ ban("req.url ~ " + req.url + " && req.http.host ~ " + req.http.host);</span><span style="color:rgb(0,0,0);font-family:verdana,arial,helvetica,sans-serif;font-size:13.3333px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:verdana,arial,helvetica,sans-serif;font-size:13.3333px"><br></span></div><div><font color="#000000" face="verdana, arial, helvetica, sans-serif"><span style="font-size:13.3333px">bad html formatting, that will should soon will be fixed, thanks.</span></font></div><div><font color="#000000" face="verdana, arial, helvetica, sans-serif"><span style="font-size:13.3333px"><br></span></font></div><div><font color="#000000" face="verdana, arial, helvetica, sans-serif"><span style="font-size:13.3333px">If there's another issue, please give us the error message.</span></font></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div>
<br><div class="gmail_quote">On Mon, Sep 18, 2017 at 12:16 AM, Andrew Incorvia <span dir="ltr"><<a href="mailto:live4life@usa.net" target="_blank">live4life@usa.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="font-family:verdana,arial,helvetica,sans-serif;font-size:10pt;color:#000000">
Hello Varnish-cache Community:
<br>
<br>Ubuntu 16.04.3
<br>Varnish-Cache 5.1.3
<br>Apache 2.4.18
<br>
<br>I could use a little help with getting the default.vcl correct for use with WP and phpmyadmin
<br>
<br>Want I want to do is exclude these paths from varnish:
<br>
<br>myipaddress_hostname/<wbr>phpmyadmin/     [without hardcoding the myipaddress_hostname]
<br>
<br>and also
<br>
<br>myipaddress_hostname/wp-login.<wbr>php
<br>
<br>
<br>Additionally,
<br>
<br>I want to handle cookies correctly as per:
<br><a href="https://info.varnish-software.com/blog/step-step-speed-wordpress-varnish-software" target="_blank">https://info.varnish-software.<wbr>com/blog/step-step-speed-<wbr>wordpress-varnish-software</a>
<br>[This article is old, and I believe the syntax is causing issues as I tried, and Varnish-Cache would not start.]
<br>
<br>Thanks!
<br>
<br>A.I
<br>
<br>My default.vcl
<br>
<br>#
<br># This is an example VCL file for Varnish.
<br>#
<br># It does not do anything by default, delegating control to the
<br># builtin VCL. The builtin VCL is called when there is no explicit
<br># return statement.
<br>#
<br># See the VCL chapters in the Users Guide at <a href="https://www.varnish-cache.org/docs/" target="_blank">https://www.varnish-cache.org/<wbr>docs/</a>
<br># and <a href="https://www.varnish-cache.org/trac/wiki/VCLExamples" target="_blank">https://www.varnish-cache.org/<wbr>trac/wiki/VCLExamples</a> for more examples.
<br>
<br># Marker to tell the VCL compiler that this VCL has been adapted to the
<br># new 4.0 format.
<br>vcl 4.0;
<br>
<br># Default backend definition. Set this to point to your content server.
<br>backend default {
<br>    .host = "127.0.0.1";
<br>    .port = "8080";
<br>}
<br>
<br>### Exluding URLs from Caching ###
<br>sub vcl_recv {
<br>   if (req.url ~ "^/phpmyadmin/") {
<br>      return (pass);
<br>   }
<br>}
<br>
<br>sub vcl_recv {
<br>    # Happens before we check if we have this in cache already.
<br>    #
<br>    # Typically you clean up the request here, removing cookies you don't need,
<br>    # rewriting the request, etc.
<br>
<br>if (req.method == "PURGE") {
<br>
<br>if (req.http.X-Purge-Method == "regex") {
<br>
<br>ban("req.url ~ " + req.url + " &amp;&amp; req.http.host ~ " + req.http.host);
<br>
<br>return (synth(200, "Banned."));
<br>
<br>} else {
<br>
<br>return (purge);
<br>
<br>}
<br>}
<br>
<br>set req.http.cookie = regsuball(req.http.cookie, "wp-settings-\d+=[^;]+(; )?", "");
<br>
<br>set req.http.cookie = regsuball(req.http.cookie, "wp-settings-time-\d+=[^;]+(; )?", "");
<br>
<br>set req.http.cookie = regsuball(req.http.cookie, "wordpress_test_cookie=[^;]+(; )?", "");
<br>
<br>if (req.http.cookie == "") {
<br>
<br>unset req.http.cookie;
<br>}
<br>}
<br>
<br>sub vcl_backend_response {
<br>    # Happens after we have read the response headers from the backend.
<br>    #
<br>    # Here you clean the response headers, removing silly Set-Cookie headers
<br>    # and other mistakes your backend does.
<br>}
<br>
<br>sub vcl_deliver {
<br>    # Happens when we have all the pieces we need, and are about to send the
<br>    # response to the client.
<br>    #
<br>    # You can do accounting or modifying the final object here.
<br>}
<br>
<br>

<br>
</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>