Home About Blog

Can I force traffic to HTTPS, if so, how?

We often have site owners or developers that would like to force traffic to their site to be HTTPS. Not only is this great for security, it will improve SEO as well.

You can force the HTTPS by issuing a redirect from the origin for HTTP traffic, but a better way is to do this in the caching layer because it reduces traffic to the origin and is faster.

An example of this in Varnish 4.x

Here is an example in Varnish 3.x