Correct HTTP scheme in WSGI with Cloudflare
Read OriginalThis technical article explains a common problem where Cloudflare's Flexible SSL mode causes WSGI applications to incorrectly report the HTTP scheme as 'http' instead of 'https'. It details the issue with headers like X-Forwarded-Proto, discusses limitations with multiple proxies (e.g., Heroku), and provides a Python WSGI middleware solution that uses Cloudflare's Cf-Visitor header to correctly set the wsgi.url_scheme.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser