Home About Blog

How do I tell which protocol a request is using, HTTP or HTTPS?

We’ve just had a question from a user:

I have a question about how to detect HTTP request in the VCL, tried a few attempts and couldn’t find any information about it.
What I am intending to do is a HTTPS redirection for a domain (ie only do HTTPS connection for the domain).

section.io will store the connecting protocol of the request in the x-forwarded-proto header.