<div dir="ltr">Hi all,<br><br>I'm trying to show management as a proof of concept varnish on freebsd 7.2. I know it's supposed to be a reverse proxy and probably locally to your network, but since we have no webserver, I want to set it up and point it to ikea's website (just as a proof of concept).<br>
<br>My default.vcl is:<br><br>backend www {<br>.host = "<a href="http://www.ikea.com.sa">www.ikea.com.sa</a>";<br>.port = "80";<br>}<br><br>backend www1 {<br>.host = "<a href="http://www.ikeasaudi.com">www.ikeasaudi.com</a>";<br>
.port = "80";<br>}<br><br>sub vcl_recv {<br>if (req.http.host ~ "^<a href="http://ikea.com.sa">ikea.com.sa</a>$") {<br> set req.backend = www;<br> }<br>}<br><br>sub vcl_recv {<br>if (req.http.host ~ "^<a href="http://ikeasaudi.com">ikeasaudi.com</a>$") {<br>
set req.backend = www1;<br> }<br>}<br><br><br># File type that we will always cache<br>sub vcl_recv {<br>if (req.request == "GET" && req.url ~ "\.(gif|jpg|swf|css|js|png|jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|css|js|vsd|doc|ppt|pps|xls|pdf|mp3|mp4|m4a|ogg|mov|avi|wmv|sxw|zip|gz|bz2|tgz|tar|rar|odc|odb|odf|odg|odi|odp|ods|odt|sxc|sxd|sxi|sxw|dmg|torrent|deb|msi|iso|rpm)$") {<br>
lookup;<br> }<br>}<br><br><br><br>Here is part of the logs, how can I tell it's working?<br><br><br> 11 SessionOpen c 192.168.1.241 57592 :80<br> 11 ReqStart c 192.168.1.241 57592 419225077<br>
11 RxRequest c GET<br> 11 RxURL c <a href="http://www.ikea.com.sa/">http://www.ikea.com.sa/</a><br> 11 RxProtocol c HTTP/1.1<br> 11 RxHeader c Host: <a href="http://www.ikea.com.sa">www.ikea.com.sa</a><br>
11 RxHeader c User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10<br> 11 RxHeader c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br>
11 RxHeader c Accept-Language: en-us,en;q=0.5<br> 11 RxHeader c Accept-Encoding: gzip,deflate<br> 11 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7<br> 11 RxHeader c Keep-Alive: 300<br>
11 RxHeader c Proxy-Connection: keep-alive<br> 11 RxHeader c Cookie: f3571cbb2ae4c36582c82e33e80ba2a8=-; mbfcookie[lang]=en; virtuemart=08490ee0f3529658159d22f4b334078d<br> 11 VCL_call c recv<br> 11 VCL_return c pass<br>
11 VCL_call c pass<br> 11 VCL_return c pass<br> 12 BackendOpen b www 192.168.1.109 59301 70.40.211.108 80<br> 11 Backend c 12 www www<br> 12 TxRequest b GET<br> 12 TxURL b <a href="http://www.ikea.com.sa/">http://www.ikea.com.sa/</a><br>
12 TxProtocol b HTTP/1.1<br> 12 TxHeader b Host: <a href="http://www.ikea.com.sa">www.ikea.com.sa</a><br> 12 TxHeader b User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10<br>
12 TxHeader b Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<br> 12 TxHeader b Accept-Language: en-us,en;q=0.5<br> 12 TxHeader b Accept-Encoding: gzip,deflate<br> 12 TxHeader b Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>
12 TxHeader b Proxy-Connection: keep-alive<br> 12 TxHeader b Cookie: f3571cbb2ae4c36582c82e33e80ba2a8=-; mbfcookie[lang]=en; virtuemart=08490ee0f3529658159d22f4b334078d<br> 12 TxHeader b X-Varnish: 419225077<br>
12 TxHeader b X-Forwarded-For: 192.168.1.241<br> 0 CLI - Rd ping<br> 0 CLI - Wr 0 200 PONG 1242183717 1.0<br> 12 RxProtocol b HTTP/1.1<br> 12 RxStatus b 200<br> 12 RxResponse b OK<br>
12 RxHeader b Date: Wed, 13 May 2009 06:01:55 GMT<br> 12 RxHeader b Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635<br> 12 RxHeader b X-Powered-By: PHP/5.2.9<br>
12 RxHeader b Expires: Mon, 26 Jul 1997 05:00:00 GMT<br> 12 RxHeader b Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br> 12 RxHeader b Pragma: no-cache<br> 12 RxHeader b Set-Cookie: f3571cbb2ae4c36582c82e33e80ba2a8=45af50eab544822fcdef7e40005cb6d4; path=/<br>
12 RxHeader b Set-Cookie: lang=deleted; expires=Tue, 13-May-2008 06:01:55 GMT; path=/<br> 12 RxHeader b Set-Cookie: mbfcookie=deleted; expires=Tue, 13-May-2008 06:01:55 GMT; path=/<br> 12 RxHeader b Set-Cookie: mbfcookie[lang]=en; expires=Thu, 14-May-2009 06:01:56 GMT; path=/<br>
12 RxHeader b Last-Modified: Wed, 13 May 2009 06:01:56 GMT<br> 12 RxHeader b Transfer-Encoding: chunked<br> 12 RxHeader b Content-Type: text/html<br> 11 ObjProtocol c HTTP/1.1<br> 11 ObjStatus c 200<br>
11 ObjResponse c OK<br> 11 ObjHeader c Date: Wed, 13 May 2009 06:01:55 GMT<br> 11 ObjHeader c Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635<br>
11 ObjHeader c X-Powered-By: PHP/5.2.9<br> 11 ObjHeader c Expires: Mon, 26 Jul 1997 05:00:00 GMT<br> 11 ObjHeader c Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br> 11 ObjHeader c Pragma: no-cache<br>
11 ObjHeader c Set-Cookie: f3571cbb2ae4c36582c82e33e80ba2a8=45af50eab544822fcdef7e40005cb6d4; path=/<br> 11 ObjHeader c Set-Cookie: lang=deleted; expires=Tue, 13-May-2008 06:01:55 GMT; path=/<br> 11 ObjHeader c Set-Cookie: mbfcookie=deleted; expires=Tue, 13-May-2008 06:01:55 GMT; path=/<br>
11 ObjHeader c Set-Cookie: mbfcookie[lang]=en; expires=Thu, 14-May-2009 06:01:56 GMT; path=/<br> 11 ObjHeader c Last-Modified: Wed, 13 May 2009 06:01:56 GMT<br> 11 ObjHeader c Content-Type: text/html<br> 12 BackendReuse b www<br>
11 TTL c 419225077 RFC 0 1242183717 1242194515 869893200 0 0<br> 11 VCL_call c fetch<br> 11 VCL_return c pass<br> 11 Length c 41666<br> 11 VCL_call c deliver<br> 11 VCL_return c deliver<br>
11 TxProtocol c HTTP/1.1<br> 11 TxStatus c 200<br> 11 TxResponse c OK<br> 11 TxHeader c Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635<br>
11 TxHeader c X-Powered-By: PHP/5.2.9<br> 11 TxHeader c Expires: Mon, 26 Jul 1997 05:00:00 GMT<br> 11 TxHeader c Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<br> 11 TxHeader c Pragma: no-cache<br>
11 TxHeader c Set-Cookie: f3571cbb2ae4c36582c82e33e80ba2a8=45af50eab544822fcdef7e40005cb6d4; path=/<br> 11 TxHeader c Set-Cookie: lang=deleted; expires=Tue, 13-May-2008 06:01:55 GMT; path=/<br> 11 TxHeader c Set-Cookie: mbfcookie=deleted; expires=Tue, 13-May-2008 06:01:55 GMT; path=/<br>
11 TxHeader c Set-Cookie: mbfcookie[lang]=en; expires=Thu, 14-May-2009 06:01:56 GMT; path=/<br> 11 TxHeader c Last-Modified: Wed, 13 May 2009 06:01:56 GMT<br> 11 TxHeader c Content-Type: text/html<br> 11 TxHeader c Content-Length: 41666<br>
11 TxHeader c Date: Wed, 13 May 2009 03:01:58 GMT<br> 11 TxHeader c X-Varnish: 419225077<br> 11 TxHeader c Age: 1<br> 11 TxHeader c Via: 1.1 varnish<br> 11 TxHeader c Connection: keep-alive<br>
11 ReqEnd c 419225077 1242183716.319736719 1242183718.637232304 0.004083157 2.315966845 0.001528740<br> 0 StatAddr - 192.168.1.241 0 2 1 1 0 1 1 831 41666<br> 11 ReqStart c 192.168.1.241 57592 419225078<br>
11 RxRequest c GET<br> 11 RxURL c <a href="http://www.ikeasaudi.com/ikea.com.sa/mambots/system/jceutils/jscripts/jceutils.js">http://www.ikeasaudi.com/ikea.com.sa/mambots/system/jceutils/jscripts/jceutils.js</a><br>
11 RxProtocol c HTTP/1.1<br> 11 RxHeader c Host: <a href="http://www.ikeasaudi.com">www.ikeasaudi.com</a><br> 11 RxHeader c User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10<br>
11 RxHeader c Accept: */*<br> 11 RxHeader c Accept-Language: en-us,en;q=0.5<br> 11 RxHeader c Accept-Encoding: gzip,deflate<br> 11 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7<br> 11 RxHeader c Keep-Alive: 300<br>
11 RxHeader c Proxy-Connection: keep-alive<br> 11 RxHeader c Referer: <a href="http://www.ikea.com.sa/">http://www.ikea.com.sa/</a><br> 11 RxHeader c Cookie: f3571cbb2ae4c36582c82e33e80ba2a8=4e2be3c5222672b31f039dd97864ddb5; mbfcookie[lang]=en; virtuemart=e4e5db67f6e31914d714315b3d0048f8<br>
11 RxHeader c If-Modified-Since: Sun, 10 May 2009 21:03:14 GMT<br> 11 RxHeader c If-None-Match: "41e9599-e72-4699530a4e880"<br> 11 VCL_call c recv<br> 11 VCL_return c lookup<br> 11 VCL_call c hash<br>
11 VCL_return c hash<br> 11 VCL_call c miss<br> 11 VCL_return c fetch<br><br></div>