How to make this work with CNAMEd cdn?

Hello. I used certbot to install this for my entirely nginx server, with phpfpm. We don’t have apache at all. This works for the domain However now we also need this to work for, which is the cname for a cloudfront distribution. How do we make that work?

And will the https work also for Wordpress? Our entire nginx hosting is for Wordpress that powers our website.

In this case our website is The main domains (.com and the www…com) need to be Lets Encrypt. But there’s also a, which is just a CNAME to Cloudfront.

I’d suggest that you don’t use Let’s Encrypt for your CloudFront subdomain. Use Amazon’s AWS Certificate Manager to issue a certificate and attach it to your CloudFront distribution. Their certificates are free, valid for 13 months, created using traditional email validation, and should renew automagically.

You can use Amazon’s APIs to upload Let’s Encrypt certificates to ACM and use them with CloudFront, but it sounds like more of a hassle to me.

Of course, it’s great to use Let’s Encrypt for your primary site. :smile: But i think it’s easier to integrate CloudFront with Amazon’s own CA.

Thank you. Kind of where I landed up in my imagination. But just to check: it’s totally OK to have the main domain ( and to be powered by LE, but within the pages of the website have CDN urls based on cnames ( that are powered by AWS’ own certs?

Yup! It’s fine. :smiley:

1 Like

Thank you so much.

Now I have the actual big issue. Nginx doesn't seem to like LE generated certificates, or perhaps my conf file has wrong instructions? I've just lifted them from the web.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.