<div dir="ltr">Hi,<div><br></div><div>You're on 2.1. That ancient and I would not recommend running it. !~ was introduced in 3.0. Try the suggestion from Thomas if you must stay on 2.1.</div><div><br></div><div><div class="im" style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<br> if (req.request == "PURGE" ) {<br></div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> if (client.ip ~ purge) {</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> return (lookup);</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> }</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> error 403 "Forbidden";</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> }</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
</div><div><br></div><div>Per.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 4:46 PM, Andrew Langhorn <span dir="ltr"><<a href="mailto:andrew.langhorn@digital.cabinet-office.gov.uk" target="_blank">andrew.langhorn@digital.cabinet-office.gov.uk</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">The VCC compiler doesn't like that syntax, I'm afraid, Per.<div><br></div><div><pre style="font-family:Monaco,Menlo,Consolas,'Courier New',monospace;font-size:12px;white-space:pre-wrap;padding:0px;margin-top:0px;margin-bottom:0px;line-height:16px;color:rgb(51,51,51);word-break:break-all;word-wrap:break-word;border:none;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-image:inherit">
Message from VCC-compiler:
Invalid condition '!~' on IP number variable
only '==', '!=' and '~' are legal
(input Line 121 Pos 21)
if (client.ip !~ purge) {
--------------------##---------
Running VCC-compiler failed, exit 1VCL compilation failed</pre></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 26 February 2014 15:39, Andrew Langhorn <span dir="ltr"><<a href="mailto:andrew.langhorn@digital.cabinet-office.gov.uk" target="_blank">andrew.langhorn@digital.cabinet-office.gov.uk</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">Thanks Per. I'll give that a go.<div>I was using a tutorial at <a href="https://www.varnish-cache.org/docs/2.1/tutorial/purging.html" target="_blank">https://www.varnish-cache.org/docs/2.1/tutorial/purging.html</a> - maybe that needs to be updated if it's wrong?</div>
<div><br></div><div>I'll let you all know how I get on.</div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On 26 February 2014 15:33, Per Buer <span dir="ltr"><<a href="mailto:perbu@varnish-software.com" target="_blank">perbu@varnish-software.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">Hi,<div><br></div><div>I see quite a lot of answers but for some reason noone has noticed the obvious error here. :-)</div>
<div><br></div><div><div class="gmail_extra"><div class="gmail_quote"><div>On Tue, Feb 25, 2014 at 5:31 PM, Andrew Langhorn <span dir="ltr"><<a href="mailto:andrew.langhorn@digital.cabinet-office.gov.uk" target="_blank">andrew.langhorn@digital.cabinet-office.gov.uk</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>
<br>
</div><div>
<div>The section that Varnish seems to trip up on is:</div><div><br></div><div> if (req.request == "PURGE" ) {<br></div><div><div> if (!client.ip ~ purge) {</div><div> error 403 "Forbidden";</div>
<div> }</div><div> return (lookup);</div><div> }</div></div></div></div></blockquote><div><br></div><div>What I'm guessing you are trying to say is</div><div> if (client.ip !~ purge) {</div><div> error 403 "Forbidden";</div>
<div> } <br></div><div><br></div><div>"!client.ip" doesn't make sense in my book as client.ip isn't boolean.</div><span><font color="#888888"><div><br></div></font></span></div><span><font color="#888888"><div>
<br></div>-- <br><div dir="ltr"><div style="color:rgb(34,34,34);font-size:12.727272033691406px;font-family:arial,sans-serif;margin:5px 15px 0px 0px;padding-bottom:5px">
<table border="0" cellpadding="0" cellspacing="0" style="text-align:start;font-size:12px;line-height:1.5em;font-family:'Helvetica Neue',Arial,sans-serif;color:rgb(102,102,102);width:550px;border-top-width:1px;border-top-style:solid;border-top-color:rgb(238,238,238);border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);margin-top:20px;padding-top:5px;padding-bottom:5px">
<tbody><tr><td width="100" style="font-family:arial,sans-serif;margin:0px"><a href="http://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank"><img src="http://www.varnish-software.com/static/media/logo-email.png" style="float:left;margin-left:10px"></a></td>
<td style="font-family:arial,sans-serif;margin:0px"><b style="font-size:14px;color:rgb(34,34,34)">Per Buer</b><br>CTO | Varnish Software<br>Phone: <a href="tel:%2B47%20958%2039%20117" value="+4795839117" target="_blank">+47 958 39 117</a> | Skype: per.buer<br>
<span style="font-weight:bold">We Make Websites Fly!<br>
<br></span><span style="font-family:'Helvetica Neue',Arial,sans-serif;font-size:14px;font-weight:bold">Winner of the Red Herring Top 100 Global Award 2013<br></span><p style="margin:0px;line-height:normal;font-family:Helvetica">
<img src="https://www.varnish-software.com/sites/default/files/redherring_2013_winner_sml.jpg"></p><span style="font-weight:bold"><br></span></td></tr></tbody></table><div></div></div><div style="clear:both;color:rgb(34,34,34);font-size:12.727272033691406px;font-family:arial,sans-serif;margin:15px 0px">
</div></div>
</font></span></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div>-- <br><div><div dir="ltr">Kind regards,<div><br></div><div>Andrew Langhorn</div><div>Web Operations</div><div>Government Digital Service</div><div>
<br></div><div>e: <a href="mailto:andrew.langhorn@digital.cabinet-office.gov.uk" target="_blank">andrew.langhorn@digital.cabinet-office.gov.uk</a></div>
<div>t: <a href="tel:%2B44%20%280%297810%20737375" value="+447810737375" target="_blank">+44 (0)7810 737375</a></div><div>a: 6th Floor, Aviation House, 125 Kingsway, London, WC2B 6NH</div></div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Kind regards,<div><br></div><div>Andrew Langhorn</div><div>Web Operations</div><div>Government Digital Service</div><div><br></div><div>e: <a href="mailto:andrew.langhorn@digital.cabinet-office.gov.uk" target="_blank">andrew.langhorn@digital.cabinet-office.gov.uk</a></div>
<div>t: <a href="tel:%2B44%20%280%297810%20737375" value="+447810737375" target="_blank">+44 (0)7810 737375</a></div><div>a: 6th Floor, Aviation House, 125 Kingsway, London, WC2B 6NH</div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div style="font-size:12.727272033691406px;margin:5px 15px 0px 0px;padding-bottom:5px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
<table border="0" cellpadding="0" cellspacing="0" style="text-align:start;font-size:12px;line-height:1.5em;font-family:'Helvetica Neue',Arial,sans-serif;color:rgb(102,102,102);width:550px;border-top-width:1px;border-top-style:solid;border-top-color:rgb(238,238,238);border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);margin-top:20px;padding-top:5px;padding-bottom:5px">
<tbody><tr><td width="100" style="font-family:arial,sans-serif;margin:0px"><a href="http://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank"><img src="http://www.varnish-software.com/static/media/logo-email.png" style="float:left;margin-left:10px"></a></td>
<td style="font-family:arial,sans-serif;margin:0px"><b style="font-size:14px;color:rgb(34,34,34)">Per Buer</b><br>CTO | Varnish Software<br>Phone: +47 958 39 117 | Skype: per.buer<br><span style="font-weight:bold">We Make Websites Fly!<br>
<br></span><span style="font-family:'Helvetica Neue',Arial,sans-serif;font-size:14px;font-weight:bold">Winner of the Red Herring Top 100 Global Award 2013<br></span><p style="margin:0px;line-height:normal;font-family:Helvetica">
<img src="https://www.varnish-software.com/sites/default/files/redherring_2013_winner_sml.jpg"></p><span style="font-weight:bold"><br></span></td></tr></tbody></table><div></div></div><div style="font-size:12.727272033691406px;margin:15px 0px;clear:both;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">
</div></div>
</div>