Setting up a website behind Cloudflare proxies
If you are moving a website (Wordpress e.g.) to a new server, after you have transferred the files and database and set up the webserver, you need to enable SSL on your new server as well, because the Cloudflare will refuse to connect to your new server.
To do this enable apache ssl module
a2enmod ssl systemctl restart apache2
Now go to Cloudflare DNS settings and point the A record to your new server's IP and change the proxy setting from “Proxied” to “DNS only”. This is only temporary so that we can generate the Letsencrypt certificates.
Now install certbot and get the certificates for your site.
After that you can reenable the “Proxied” option at Cloudflare.
- Debian 10
- certbot 0.31.0-1+deb10u1