Error 502 after installing Lets Encrypt on Digital Ocean VPS

Hello all, my site runs on a VPS. I have Ubuntu 26, apache. I successfully installed cerbot on my site. Now my site is not running. Error 502. I use Cloudfare. Will be grateful is somebody can tell what changes I have to make in Cloudfare. Under crypto > SSL, it shows Status Active Certificate. Always use HTTPS is ON. Automatic HTTPS Rewrites is ON. Port 443 is allowed in VPS.

Those settings look good at the Cloudflare end.

After installing Certbot, did you successfully install a Let’s Encrypt certificate?

Which Crypto->SSL setting are you using? Full, Full/Strict, or Flexible?

Which 502 error are you getting? Top or bottom, according to the following support article:
https://support.cloudflare.com/hc/en-us/articles/218378978-What-should-I-do-after-seeing-a-502-or-504-gateway-error-on-my-site-

Thanks for your reply. We are receiving a 525 ssl handshake failure error
now. We have posted another request specifying associated details. We are
using Full in Crypto - ssl.
Highly expect that you would go through the error and related detail in our
next request and reply with something useful to fix that.
Regards

A 525 means something is wrong with the SSL on your server. I find the best way to fix this is to :grey: your server on Cloudflare’s DNS so you can troubleshoot the certificate on your server.

https://support.cloudflare.com/hc/en-us/articles/200278659-Error-525-SSL-handshake-failed