{"id":2089,"date":"2015-02-05T13:53:51","date_gmt":"2015-02-05T13:53:51","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=2089"},"modified":"2015-02-05T13:54:21","modified_gmt":"2015-02-05T13:54:21","slug":"configure-multiple-sites-with-varnish","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=2089","title":{"rendered":"Configure multiple sites with Varnish"},"content":{"rendered":"<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;height:300px;\"><div class=\"text codecolorer\">backend example1 {<br \/>\n&nbsp; &nbsp; &nbsp;.host = &quot;backend.example1.com&quot;;<br \/>\n&nbsp; &nbsp; &nbsp;.port = &quot;8080&quot;;<br \/>\n&nbsp;}<br \/>\n&nbsp;backend example2 {<br \/>\n&nbsp; &nbsp; &nbsp; .host = &quot;backend.example2.com&quot;;<br \/>\n&nbsp; &nbsp; &nbsp; .port = &quot;8080&quot;;<br \/>\n&nbsp;}<br \/>\n&nbsp;sub vcl_recv {<br \/>\n&nbsp; &nbsp; if (req.http.host == &quot;example1.com&quot;) {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; #You will need the following line only if your backend has multiple virtual host names<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; set req.http.host = &quot;backend.example1.com&quot;;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; set req.backend = example1;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; return (lookup);<br \/>\n&nbsp; &nbsp; }<br \/>\n&nbsp; &nbsp; if (req.http.host == &quot;example2.com&quot;) {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; #You will need the following line only if your backend has multiple virtual host names<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; set req.http.host = &quot;backend.example2.com&quot;;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; set req.backend = example2;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; return (lookup);<br \/>\n&nbsp; &nbsp; }<br \/>\n&nbsp;}<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>backend example1 { &nbsp; &nbsp; &nbsp;.host = &quot;backend.example1.com&quot;; &nbsp; &nbsp; &nbsp;.port = &quot;8080&quot;; &nbsp;} &nbsp;backend example2 { &nbsp; &nbsp; &nbsp; .host = [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2089","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2089"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2089\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}