How can I force HTTP instead of HTTPS when getting content from my origin?

I want SSL Everywhere, Full SEO improvements and HTTP/2 performance improvements - but my origin server isn’t set up for HTTPS.

How can I make section.io keep HTTPS for my customers, but pull content using HTTP?

In order to force section.io to fetch using HTTP when using Varnish Cache, even when the browser is still using HTTPS, unset the X-Forwarded-Proto HTTP request header in your vcl_recv function.

For example:

sub vcl_recv {
    unset http.req.X-Forwarded-Proto;
}

You’ve probably got other logic in that function, so you’ll need to make sure you put it in a sensible place.

Thanks Daniel,

Almost works 100%…

try
sub vcl_recv {
unset req.http.X-Forwarded-Proto;
}

Hey Liam,

Thanks for the catch there!

The correct syntax is:

sub vcl_recv {
    unset req.http.X-Forwarded-Proto;
}