Developers experiencing browser SSL certificate errors, redirection loops, or warning padlocks on their websites.
- ✓Ubuntu VPS or web hosting with root/cPanel access
- ✓Active domain pointed to the server
🚀 What You Will Learn & Build
- ▸How TLS certificates secure web traffic
- ▸Automating free certificates with Certbot
- ▸Fixing Cloudflare 'Flexible' redirect loops
- ▸Finding and fixing mixed content (HTTP resources on HTTPS page)
1. Generating SSL with Certbot for Nginx/Apache
# Install certbot
sudo apt install -y certbot python3-certbot-nginx
# Obtain certificate and configure Nginx automatically
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
# Verify renewal timer
sudo systemctl status certbot.timer2. Fixing the Infamous 'ERR_TOO_MANY_REDIRECTS' Cloudflare Loop
✨ Expected Output & Verification
Visiting your website displays a secure lock icon in modern browsers with a valid certificate issued by Let's Encrypt or Cloudflare.
🧪 How to Test the Implementation
- 1Check certificate status via Qualys SSL Labs: https://www.ssllabs.com/ssltest/
⚠️ Common Errors & How to Fix Them
Root Cause: HTML page served via HTTPS, but loading images or scripts via http:// URLs.
Fix: Update all asset links to relative paths or https://.
🛡️ Security Considerations & Best Practices
- !Enable HTTP Strict Transport Security (HSTS) headers to force browsers to always use HTTPS.
❓ Frequently Asked Questions (FAQ)
Yes, they expire every 90 days, but Certbot installs a systemd timer that renews them automatically before expiration.
📌 Summary of Key Takeaways
- ✓Always set Cloudflare SSL mode to Full (Strict).
- ✓Certbot automates free Let's Encrypt SSL on Linux.
Official References & Further Reading
- 🔗Certbot Official Instructions— Official EFF Certbot configuration wizard.
Written by Manoj Neupane
AuthorSoftware developer and programming instructor, Nepal
Building software systems and SaaS platforms with Laravel, Next.js, and Node.js. Passionate about helping students and developers in Nepal master practical, real-world development skills.