<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Backend on Varnish Cache</title><link>https://www.varnish.org/docs/tutorials/tags/backend/</link><description>Recent content in Backend on Varnish Cache</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 01 Oct 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://www.varnish.org/docs/tutorials/tags/backend/index.xml" rel="self" type="application/rss+xml"/><item><title>Using multiple backends in Varnish</title><link>https://www.varnish.org/docs/tutorials/multiple-backends/</link><pubDate>Thu, 02 Sep 2021 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/tutorials/multiple-backends/</guid><description>&lt;p&gt;The most common Varnish setups will feature a single backend, as illustrated in the VCL snippet below:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-vcl" data-lang="vcl"&gt;vcl 4.1;

backend default {
 .host = &amp;#34;127.0.0.1&amp;#34;;
 .port = &amp;#34;8080&amp;#34;;
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;However it is also possible to define multiple backends and to use VCL logic to decide which backend to use.&lt;/p&gt;
&lt;h2 id="vcl-example"&gt;VCL example&lt;/h2&gt;
&lt;p&gt;The example below has 2 backends:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;default&lt;/code&gt; that connects to &lt;code&gt;backend.example.com&lt;/code&gt; on port &lt;code&gt;80&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;image&lt;/code&gt; that connects to &lt;code&gt;image.example.com&lt;/code&gt; on port &lt;code&gt;80&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;code&gt;image&lt;/code&gt; backend in the example is only used when the URL ends with &lt;code&gt;.png&lt;/code&gt;, &lt;code&gt;.jpg&lt;/code&gt; or &lt;code&gt;.svg&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Using basic authentication in VCL backend probes</title><link>https://www.varnish.org/docs/tutorials/vcl-backend-probe-basic-authentication/</link><pubDate>Fri, 01 Oct 2021 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/tutorials/vcl-backend-probe-basic-authentication/</guid><description>&lt;p&gt;When your Varnish server proxies requests to a backend that requires authorized access via &lt;em&gt;basic authentication&lt;/em&gt;, you need to ensure that the right &lt;code&gt;Authorization&lt;/code&gt; header is sent for each probe request.&lt;/p&gt;
&lt;h2 id="1-initial-situation"&gt;1. Initial situation&lt;/h2&gt;
&lt;p&gt;Your initial backend setup will have a backend that may contain a &lt;code&gt;.probe {}&lt;/code&gt; definition.&lt;/p&gt;
&lt;p&gt;This health-checking probe will send HTTP requests to your backend server at regular intervals. As long as a &lt;code&gt;200&lt;/code&gt; status code is returned, the backend is considered healthy.&lt;/p&gt;</description></item></channel></rss>