Hi,<br><br>I'd like to use Varnish as nothing more than a basic Internet security appliance, that is set it up with a whitelist of sites and direct all other domains to a local page which will ask for authentication, then forward along if passed. I'm trying to just get
<a href="http://google.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">google.com</a> and <a href="http://wikipedia.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
wikipedia.org</a> working as pass-through with the following VCL... and I'm having trouble. Eventually I'd like to implement caching, but I'd like to just get the simple stuff going for now.<br><br>Thanks for any insight you can provide.
<br><br>----<br> # This is a basic vcl.conf file for varnish.<br> # Modifying this file should be where you store your modification to<br> # varnish. Settnigs here will override defaults.<br> <br> backend default {
<br> set backend.host = "<a href="http://127.0.0.1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">127.0.0.1</a>";<br> set backend.port = "80"; <br>
}<br> <br> backend google {<br> set backend.host = "
<a href="http://www.google.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.google.com</a>";<br> set backend.port = "80";<br> }<br><br> backend wikipedia {<br> set
backend.host = "<a href="http://www.wikipedia.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.wikipedia.org
</a>";<br> set backend.port = "80";<br> }<br> <br> sub vcl_recv {<br> if (req.request == "POST") {<br> pipe;<br> }<br> <br> if (
req.http.host ~ "^(www\.)?google\.com$") {<br> set req.backend = google;<br> pass;<br> }<br> elseif (req.http.host ~ "^(www\.)?wikipedia\.org$") {<br> set
req.backend = wikipedia;<br> pass;<br> }<br> elseif (req.http.host ~ "^(en\.)?wikipedia\.org$") {<br> set req.backend = wikipedia;<br> pass;<br> }<br><br>
<br> # force lookup even when cookies are present<br> if (req.request == "GET" && req.http.cookie) {<br> lookup;<br> }<br> }<br> <br> sub vcl_fetch {
<br> # force minimum ttl of 180 seconds<br> if (obj.ttl < 180s) {<br> set obj.ttl = 180s;<br> }<br>}