<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Synth on Varnish Cache</title><link>https://www.varnish.org/docs/tutorials/tags/synth/</link><description>Recent content in Synth on Varnish Cache</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 13 Sep 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://www.varnish.org/docs/tutorials/tags/synth/index.xml" rel="self" type="application/rss+xml"/><item><title>Performing HTTP redirections in Varnish</title><link>https://www.varnish.org/docs/tutorials/redirect/</link><pubDate>Mon, 13 Sep 2021 00:00:00 +0000</pubDate><guid>https://www.varnish.org/docs/tutorials/redirect/</guid><description>&lt;p&gt;Varnish can perform HTTP redirections by returning a &lt;em&gt;synthetic&lt;/em&gt; &lt;code&gt;HTTP 301&lt;/code&gt; response containing a &lt;code&gt;Location&lt;/code&gt; header with the redirection endpoint.&lt;/p&gt;
&lt;p&gt;Synthetic responses are triggered by a &lt;code&gt;return (synth())&lt;/code&gt; statement called from a client-side VCL subroutine. This also requires extending the &lt;code&gt;vcl_synth&lt;/code&gt; logic and adding the necessary redirection logic.&lt;/p&gt;
&lt;h2 id="http-to-https-redirections"&gt;HTTP to HTTPS redirections&lt;/h2&gt;
&lt;p&gt;One of the most common types of HTTP redirection is HTTP to HTTPS.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s an example where an HTTP request is redirected to its HTTPS equivalent:&lt;/p&gt;</description></item></channel></rss>