How to set up https with cloudflare and infinityfree hosting
- User
How to set up https with cloudflare and infinityfree hosting
Assistant
How to set up https with cloudflare and infinityfree hosting
I'll help you set up HTTPS with Cloudflare and InfinityFree hosting. This is a common setup that provides free SSL/TLS encryption for your website. Prerequisites
A domain name An InfinityFree hosting account A Cloudflare account (free tier works fine)
Step-by-Step Setup
Log into your Cloudflare account Click "Add a Site" and enter your domain name Choose the Free plan Cloudflare will scan your existing DNS records
Cloudflare will provide you with two nameservers (like elena.ns.cloudflare.com and finn.ns.cloudflare.com) Go to your domain registrar's control panel Replace the existing nameservers with Cloudflare's nameservers This change can take 24-48 hours to propagate fully
In your Cloudflare dashboard, go to the DNS tab Add an A record pointing to your InfinityFree server's IP address You can find your InfinityFree IP in your hosting control panel under "Account Details" Make sure the cloud icon is orange (proxied) for the A record
Go to SSL/TLS tab in your Cloudflare dashboard Set the SSL/TLS encryption mode to "Flexible" (this works well with InfinityFree's shared hosting) Under "Edge Certificates," enable "Always Use HTTPS" Enable "HTTP Strict Transport Security (HSTS)" for additional security
In your InfinityFree control panel, you don't need to install any SSL certificates since Cloudflare handles the encryption Make sure your website files are uploaded to the htdocs folder Update any hardcoded HTTP links in your website to use HTTPS or relative URLs
Enable "Auto Minify" for CSS, JavaScript, and HTML Turn on "Brotli" compression Consider enabling "Rocket Loader" for faster JavaScript loading
Important Notes
Flexible SSL Mode: This encrypts traffic between visitors and Cloudflare, but the connection between Cloudflare and InfinityFree remains unencrypted. This is fine for most use cases with shared hosting. Propagation Time: DNS changes can take up to 48 hours to fully propagate worldwide. Mixed Content: After enabling HTTPS, check your website for any mixed content warnings (HTTP resources loaded on HTTPS pages).
Troubleshooting If you encounter issues:
Verify your DNS records are correct in Cloudflare Check that the nameservers have propagated using a tool like WhatsMyDNS.net Clear your browser cache and try accessing your site in incognito mode If you see SSL errors, wait a bit longer for Cloudflare's certificates to provision
The setup should provide you with a secure HTTPS connection, improved performance through Cloudflare's CDN, and additional security features, all while using InfinityFree's free hosting service.