<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 14, 2015 at 8:48 PM, Bertrand Caplet <span dir="ltr"><<a href="mailto:bertrand.caplet@chunkz.net" target="_blank">bertrand.caplet@chunkz.net</a>></span> wrote:<br><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">Hey guys,<br>
I set varnish behind a nginX proxy few days ago.<br>
I want to be able to purge varnish only from the machine where it's<br>
hosted but because there is a nginx reverse proxy in front of it,<br>
varnish thinks it's coming from 127.0.0.1 so basically whatever the<br>
client is, anyone can purge the cache.<br>
By the way I set some rules for varnish to know x-forwarded-for = client.ip. </blockquote><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">
<br>
Do you know how can I change that?<br></blockquote><div><br></div><div>See man vmod_std, look for the function "ip". It allows you to cast a string in a ip address to match it against a acl.</div><div><br></div><div>Oh. There an online version; <a href="https://www.varnish-cache.org/docs/4.0/reference/vmod_std.generated.html#ip-ip-string-ip">https://www.varnish-cache.org/docs/4.0/reference/vmod_std.generated.html#ip-ip-string-ip</a></div><div><br></div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><table border="0" cellpadding="0" cellspacing="0" style="border-bottom-width:1px;padding-top:5px;border-top-style:solid;width:550px;padding-bottom:5px;border-bottom-color:rgb(238,238,238);border-top-width:1px;border-bottom-style:solid;line-height:1.5em;border-top-color:rgb(238,238,238);color:rgb(102,102,102);font-size:12px;font-family:'Helvetica Neue',Arial,sans-serif;margin-top:20px"><tbody><tr><td width="100"><img src="http://www.varnish-software.com/static/media/logo-email.png"></td><td><font color="#222222"><span style="font-size:14px"><b>Per Buer</b></span></font><br>CTO | Varnish Software AS<br>Cell: <a value="+4790181750" style="color:rgb(17,85,204)">+47 95839117</a><br><span style="font-weight:bold">We Make Websites Fly!<br><a href="https://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank">www.varnish-software.com</a></span></td></tr></tbody></table><br><div style="color:rgb(136,136,136)"><a href="http://info.varnish-software.com/varnish-summits-autumn-2014-registration" style="color:rgb(17,85,204)" target="_blank"><img src="https://www.varnish-software.com/sites/default/files/u388/masters_s_0.png" alt=" Register now"></a></div></div></div>
</div></div>