Well, since my last post, basically nothing has worked correctly. The transfer to Cloudflare was easy at first, but getting it to interface correctly with Caddy proved too much for me.
I struggled for about 2 weeks to get Caddy to integrate with Cloudflare’s encryption. Nothing I did would get it to work much past the WordPress sites occasionally showing up. Coupled with the fact that my media drives were no longer working correctly (unrelated) it caused me to pretty much shut down on the project until now, the first week in September. Mentally, that is.
I have a large project that I need to start and finish by Christmas, so my desire to get this working has been growing daily. Today I finally figured out what I was doing wrong.
There are a few options with Cloudflare. The most basic option is no proxy which means your IP address is exposed. I wanted something more, so the next option is generating a certificate with Cloudflare and installing that on the origin server. The issue I was having was that the certificate and key files must be named ‘certificate.pem’ and ‘key.pem’, and Caddy running in Docker must have access to the location of those files. Seems simple! I toiled over this for countless hours and I do not recall ever seeing that the files must be named exactly those things. I have three domains that demand these certificates, so I was trying to keep them all in one folder and name them according to the domain. The solution is to simply put them in separate folders named for the domains. Also something I’m not sure I realized is that each domain must have its own origin certificate, but if you make them correctly, they cover subdomains with a wild card. But you must still specify the certificate and key location in the Caddy file for the subdomains.
Yikes, it’s been a nightmare. It’s been one of those things that have the potential to shut this project down for further months or longer. It still seems that some of the websites load slowly, I’m messing around with caching settings to see if those are the culpit. But everything works mostly! Pretty exciting.