Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Request.IsHttps and Request.Scheme are showing that request is HTTP instead of HTTPS

I'm working with an .Net Core web app and I need to verify the request is HTTPS. I have installed a certificate in Azure with Let's encrypt and I have a cloudflare CDN but always shows me as if the request was not HTTPS.

I've used

this.Request.Scheme.Equals("https")

and

this.Request.IsHttps

Do you have any idea what's happenning?

like image 232
Gabriel Castillo Prada Avatar asked Apr 16 '26 18:04

Gabriel Castillo Prada


1 Answers

The Cloudflare CDN, although it serves your requests as HTTPS, is actually making the request to your website as HTTP.

You are likely using Cloudflare's Flexible mode. You likely want to use one of the Full modes.

like image 190
mjwills Avatar answered Apr 19 '26 07:04

mjwills