I have a domain configured in Cloudflare, with ‘always use HTTPS’ switched on. The origin is s3. I’ve configured s3 to redirect certain paths so that the virtual paths work correctly in the web app that it is hosting. The S3 bucket is HTTP only. This config works, and I’m observing this:
I’m wondering why there are two 301 responses instead of just one. As the 301 is generated by Cloudflare and the original request is HTTPS, and ‘always use HTTPS’ is on, why does the redirection switch to HTTP in the first 301 response?
On the origin side, the incoming request is HTTP and the redirection response is HTTP. I’m wondering if Cloudflare is picking up the protocol there and using that in the 301 response that it’s generating, whilst rewriting the domain.
So functionally this works as it is, but it’s just a little strange that there’s an extra 301 and exposure of the request over HTTP.