Page 1 of 1

Cloudflare + SSL and VestaCP

Posted: Thu Oct 26, 2017 6:21 pm
by brianbws
I've spent hours reading posts, Googling, and trying different things, but I can't seem to get my website to work with Cloudflare under HTTPS.

Does anyone have this setup working? What did you do?

Website worked fine with Let's Encrypt and no Cloudflare. When I changed the name servers on the domain to point to Cloudflare nameservers it stopped working. I've tried different modes, Flexible, Full, Strict. I've tried disabling Let's Encrypt and creating a Cloudflare Origin Certificate, then adding it to Vesta CP. I've tried disabling all SSL in Vesta CP and selecting just Flexible SSL in Cloudflare. All of the above only give errors when the site is viewed under https. Would like it to work with the Cloudflare free plan.

Any help, advice?

Re: Cloudflare + SSL and VestaCP

Posted: Tue Oct 31, 2017 6:55 pm
by brianbws
So it seems it was an issue on Cloudflare's end, probably a complication from moving the site off a hosting partner to my own private VPS. I contacted Cloudflare and they did something to fix it.

So adding Cloudflare seems to be as easy as:
1. Secure site with Let's Encrypt.
2. Set up Cloudflare and change DNS to their servers
3. Set SSL to Full (strict)
4. Wait for Authorizing Certificate change to Active Certificate
5. Everything should now work under HTTPS

Re: Cloudflare + SSL and VestaCP

Posted: Sun Nov 12, 2017 10:30 pm
by StopSpazzing
brianbws wrote:I've spent hours reading posts, Googling, and trying different things, but I can't seem to get my website to work with Cloudflare under HTTPS.

Does anyone have this setup working? What did you do?

Website worked fine with Let's Encrypt and no Cloudflare. When I changed the name servers on the domain to point to Cloudflare nameservers it stopped working. I've tried different modes, Flexible, Full, Strict. I've tried disabling Let's Encrypt and creating a Cloudflare Origin Certificate, then adding it to Vesta CP. I've tried disabling all SSL in Vesta CP and selecting just Flexible SSL in Cloudflare. All of the above only give errors when the site is viewed under https. Would like it to work with the Cloudflare free plan.

Any help, advice?
Mine is working perfectly. Have same setup.

You need to do a few things... If you haven't already, Add your domain to CloudFlare, allow pass-through for now (make all clouds on DNS page grey). Run Let's Encrypt, and setup your SSL on your website, confirm it's working on https://yourdomain. Wait till cloudflare has created an SSL cert for your domain (if you just added your domain, will take a day or 2). After this is finished, put everything back "on" on the DNS page in CloudFlare. Goto Security page, make sure to use FULL SSL. I use/turn on all other security items on the page, would suggest at least forcing https on this domain.

Re: Cloudflare + SSL and VestaCP

Posted: Fri Aug 28, 2020 7:42 pm
by lzomedia
In my case, I had the script in the right order but I had to create the .well-known folder in public_html

Re: Cloudflare + SSL and VestaCP

Posted: Sat Sep 04, 2021 7:32 pm
by djwayne1985
please may i have the script for this thanks in advance

Re: Cloudflare + SSL and VestaCP

Posted: Fri Sep 24, 2021 12:21 pm
by john3121
I got the same issue back a month ago on my website.

I even asked a few of my friends who had an engineering background, but everyone suggested me that it was easy. Although, it was easy, but I wasn't able to do it. What I did

Scenario 1: You can contact the cloudflare chat support, and tell them that I don't have any technical background. They will fix it for you, they might charge you some dollars.

Scenario 2:
step 1: add domain on cloudflare (Lets say example.com)
step 2: setup cloudflare
step 3: Encrypt
step 4: Change DNS
Step 5: Set up SSL
Step 6: Wait for the response
Step 7: Everything will work fine