HTTP to HTTPS via Cloudflare
As many are aware, aMiSTACX is big on “It just works!” configurations. Why spend hours trying to hack to make something as simple as http to https redirection work?
As we also advocate Cloudflare for DNS, WAF, and CDN solutions for those that just want to get up and running as quick as possible in a user friendly GUI format, Cloudflare also happens to offer a solution to assist in addressing the complexity of HTTP to HTTPS.
Cloudflare offers two ways to accomplish this task. One is through their Always Use HTTPS [Image] feature in the edge certificates section on your Cloudflare Dashboard. The second option is by setting up a page rule.
Page rules offer a lot more granular control of the HTTP to HTTPS redirection. You can even use advanced pattern matching.
There is also a benefit of speed when taking advantage of the DNS/CDN, as the redirection takes place at the edge and offloads the request processing from the local AWS EC2 server.
The “Always use HTTPS” action in the above Cloudflare dashboard graphic is the simplest option to redirect HTTP requests to HTTPS.
The example shown will redirect all requests for example.com to HTTPS, but you can use any valid pattern to limit this action to a specific subdomain or directory.
Weaponize your Business with aMiSTACX!