Skip to main content
DrupalABC

Main navigation

  • Home
  • Search
  • Learn Drupal
  • Certifications
  • Drupal Code Finder
User account menu
  • Log in

Breadcrumb

  1. Home

How to set HTTPS on website using Nginx and CloudFlare as CDN?

First of all, you have to add the correct settings in Cloudflare under the SSL/TLS tab. Make sure it is set to Full if using self-generated/certbot generated certificate or else Full Strict if using Cloudflare provided certificate. Once the settings have been done from Cloudflare, move to the Nginx configuration of the website and set them like this:

The first server block ensures redirection to HTTPS and 2nd makes sure non-www is redirected to www. You can modify them at your convenience.  Avoid automatic NGINX redirections settings done by Certbot if using Cloudflare.

Tags
Nginx
Disqus
DrupalABC

Footer

  • Buy me a coffee
  • Drupal.org profile
  • LinkedIn
Powered by Drupal

Drupal is a registered trademark of Dries Buytaert