Cloudflare Origin Certificates: Nginx, Apache
A Cloudflare Origin CA certificate secures the connection between Cloudflare and your own server. It is free, you choose its validity period when you create it, and it lets you use the strictest SSL/TLS mode without buying or renewing a public certificate on the origin.
There is one rule to understand first: browsers do not trust this certificate. Only Cloudflare does. It works while your DNS record is proxied (orange cloud). If you turn the proxy off, visitors will see a certificate warning.
Cloudflare origin certificate or a public certificate?
| Cloudflare Origin CA | Public CA (Let's Encrypt, ZeroSSL) | |
|---|---|---|
| Trusted by browsers | No | Yes |
| Works with proxy off | No | Yes |
| Renewal | Manual, and Cloudflare sends no expiry notices | 90 days today, 64 from 10 February 2027, usually automated |
| Cost | Free | Free or paid |
| Best for | Sites that always stay behind Cloudflare | Sites that may leave Cloudflare, or need direct access |
Create the Cloudflare origin certificate
- In the Cloudflare dashboard, open your domain, then SSL/TLS and Origin Server.
- Choose Create Certificate. Let Cloudflare generate the private key, or paste your own CSR made with our CSR generator.
- Pick the key type (RSA 2048 or ECDSA) and list the hostnames, for example
example.comand*.example.com. - Pick a validity period and create it.
Copy the certificate and the private key into separate files straight away. Cloudflare says you cannot see the private key after you leave that screen (Cloudflare Origin CA docs). If you lose it, create a new certificate.
Install on Nginx
sudo mkdir -p /etc/ssl/cloudflare
sudo nano /etc/ssl/cloudflare/example.com.pem # paste the certificate
sudo nano /etc/ssl/cloudflare/example.com.key # paste the private key
sudo chmod 600 /etc/ssl/cloudflare/example.com.key
server {
listen 443 ssl;
server_name example.com www.example.com;
ssl_certificate /etc/ssl/cloudflare/example.com.pem;
ssl_certificate_key /etc/ssl/cloudflare/example.com.key;
}
Run sudo nginx -t and then sudo systemctl reload nginx.
Install on Apache
<VirtualHost *:443>
ServerName example.com
SSLEngine on
SSLCertificateFile /etc/ssl/cloudflare/example.com.pem
SSLCertificateKeyFile /etc/ssl/cloudflare/example.com.key
</VirtualHost>
Switch to Full (strict)
Go to SSL/TLS and Overview and select Full (strict). In this mode Cloudflare validates the origin certificate, and the Origin CA certificate passes that check. Test the site, then confirm the pair is intact with our key matcher if the web server refuses to start.
Optional hardening
- Allow inbound port 443 only from Cloudflare IP ranges in your firewall, so nobody can reach the origin directly.
- Consider Authenticated Origin Pulls if you want the origin to require a client certificate from Cloudflare, and check the current Cloudflare docs for the setup before you rely on it.
- Redirect HTTP to HTTPS with the HTTPS redirect generator.
Common mistakes
The first mistake is turning the proxy off while testing. The moment the record is grey-clouded, visitors reach your server directly and see an untrusted certificate. Test with the proxy on, or use a hosts-file entry to reach the origin.
The second is forgetting the apex domain. If the hostname list contains only *.example.com, the bare example.com is not covered. List both. The third is pasting the certificate without its header and footer lines, which makes Nginx report a PEM error. Keep the BEGIN and END lines exactly as shown by Cloudflare.
Finally, keep a copy of the private key in a password manager or secrets store, not in a shared folder. Anyone who holds it can impersonate your origin to Cloudflare.
Related reading: Cloudflare free SSL setup and Cloudflare Flexible vs Full vs Full (Strict).
Frequently Asked Questions
Can I use an Origin certificate without Cloudflare?
No. Browsers will show a warning because Cloudflare's origin CA is not in public trust stores.
Does it renew automatically?
No. Cloudflare does not send expiration notifications for origin CA certificates (Cloudflare Origin CA docs), so put the expiry date in your own calendar or monitoring.
Why am I still getting error 526?
Error 526 means Cloudflare could not validate the origin certificate in Full (strict) mode. Check the hostname list, the expiry date and that the server actually presents the certificate you installed. Run the SSL checker against the origin to see what it serves.
Do I need the intermediate chain?
Not for Cloudflare. It validates the Origin CA certificate directly.
Do browsers trust a Cloudflare Origin CA certificate?
No. Only Cloudflare validates it, which is why it works solely for proxied traffic. If you pause Cloudflare or grey-cloud a record, visitors see a certificate error.
✅ Post-Installation Verification & SEO Checklist
After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:
- Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
- Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
- Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
- Confirm both root and
wwwversions resolve cleanly to one canonical HTTPS URL. - Verify your HTTPS property and
sitemap.xmlinside Google Search Console and Bing Webmaster Tools.