How to Install a Cloudflare Origin Certificate on Nginx (aaPanel Tested)

Cloudflare SSL/TLS encryption card showing Full (strict) mode for my origin certificate test.

A Cloudflare origin certificate is a free certificate that Cloudflare signs for your own server. Install it on the server, switch Cloudflare’s SSL/TLS mode to Full (strict), and the connection between Cloudflare and your site is encrypted and properly checked, with no renewal job on the server.

I installed one on an Nginx server managed by aaPanel and checked the result with curl and openssl at each stage. Before it, the same server had a self-signed certificate and Cloudflare returned error 526 in Full (strict) mode. After it, the same request returned 200. A direct request that skipped Cloudflare still failed, which is normal, and I show why below.

Tested by Dolon Bepari, 20 and 21 November 2026

  • Server: a throwaway Ubuntu 22.04 VPS (1 vCPU, about 2 GB RAM), aaPanel 7, Nginx 1.30.7, PHP 8.4, WordPress
  • Cloudflare: Free plan, orange cloud (proxied), test domain filecafe.site
  • Certificate: Cloudflare Origin CA, RSA 2048, filecafe.site and *.filecafe.site, 7 days
  • How I measured: curl from my PC in Dhaka, Bangladesh, through Cloudflare, plus curl and openssl on the server itself
  • There are no affiliate links in this guide. How I test: how we review

The steps in short

  1. In Cloudflare, open SSL/TLS, Origin Server, Create Certificate. Keep “Generate private key and CSR with Cloudflare”, pick RSA (2048), keep the hostnames and choose a validity.
  2. Copy the Origin Certificate and the Private Key right away. The key is not shown again once you leave the page.
  3. Install both on the server: in aaPanel, the site’s SSL tab; on plain Nginx, two files and two lines in the server block.
  4. Check on the server that Nginx now serves the Cloudflare origin certificate.
  5. Set Cloudflare’s SSL/TLS encryption mode to Full (strict).
  6. Test through Cloudflare. You want 200, not 526.

What a Cloudflare origin certificate is (and what it is not)

Cloudflare sits between your visitors and your server (the origin). There are two connections: browser to Cloudflare, and Cloudflare to origin. The padlock visitors see comes from Cloudflare’s own edge certificate. An origin certificate covers only the second connection.

Cloudflare’s Origin CA docs (last updated 14 August 2026, checked 21 November 2026) say these certificates only encrypt traffic between Cloudflare and your origin server. Browsers do not trust the authority that signs them. That is fine as long as every visitor reaches the server through Cloudflare’s proxy. It is not fine if you turn the orange cloud off, pause Cloudflare, or point a hostname at the server without the proxy; then visitors get a certificate warning.

The certificate is meant for Full (strict), the mode in which Cloudflare checks that the origin’s certificate is valid and matches the hostname. In plain Full mode Cloudflare encrypts the connection but accepts any certificate, even a self-signed one, which is why Full worked with my self-signed certificate and Full (strict) did not.

Cloudflare origin certificate vs Let’s Encrypt

This is the choice most people are really making. Both are free and both work with Full (strict). The difference is who trusts them and how often they renew.

Cloudflare origin certificateLet’s Encrypt
Trusted by browsersNo, only by CloudflareYes
ValidityYou choose when you create it; the creation page says 15 years by defaultShort, measured in weeks or months, so it must renew automatically
Renewal on your serverNone until it expiresNeeds a working renewal job (aaPanel and most panels run it for you)
Works with the orange cloud offNo, visitors see a warningYes
WildcardIncluded by default (one level)Only with DNS validation
Expiry email from the issuerNo (Cloudflare’s docs say so)No (Let’s Encrypt ended its expiry emails in 2025), so rely on auto-renewal or your own monitoring

My rule: if the site will always stay proxied, the origin certificate is the one that cannot break because a renewal job failed. If you might ever switch the proxy off, or you serve some hostnames without Cloudflare, use Let’s Encrypt.

Step 1: Create the origin certificate in Cloudflare

No command is needed for this step. In the Cloudflare dashboard:

  1. Open your domain, then SSL/TLS, Origin Server, and click Create Certificate.
  2. Keep Generate private key and CSR with Cloudflare (a CSR is the certificate signing request; Cloudflare makes it and the private key for you). Choose RSA (2048) unless you know your server prefers ECC, a newer and smaller key type.
  3. Check the hostnames. By default the certificate covers your apex domain and one wildcard (for example example.com and *.example.com). Add deeper names, such as a.b.example.com, here if you need them.
  4. Choose the Certificate Validity. The page says the default is fifteen (15) years. I chose 7 days because this was a test server.
  5. Click Create. Leave the key format as PEM (plain text that starts with a -----BEGIN line, what Nginx and aaPanel expect) and copy both the Origin Certificate and the Private Key into a text editor.
Cloudflare Origin Certificate Installation form with RSA (2048), the hostnames *.filecafe.site and filecafe.site, and 7 days validity.
The creation form on my test domain: RSA (2048), apex plus wildcard, 7 days.

Copy the private key now. Cloudflare’s docs say it is not viewable after you leave the screen. If you lose it, revoke that certificate and create a new one. Keep the key out of email and chat, and never put it in a screenshot.

Step 2: Install the origin certificate on Nginx or aaPanel

On aaPanel (what I used)

aaPanel writes the certificate into the site’s Nginx config for you. No command is needed:

  1. In aaPanel, open Website, click your site, and open the SSL tab.
  2. On the Current Certs tab there are two boxes: one for the private key and one for the certificate. Paste the Private Key from Cloudflare into the key box and the Origin Certificate into the certificate box. Each block starts with a -----BEGIN line and ends with an -----END line; copy them whole.
  3. Click Save; aaPanel applies the certificate to the site’s Nginx config.

aaPanel then listed the certificate as deployed (the screenshot below is from later that night): Certificate type: Other certificate, the domains *.filecafe.site, filecafe.site, and the expiry date 2026-11-27, the same date Cloudflare put on the certificate. It also showed a red tip that the certificate would expire in 6 days. That is a useful extra, because Cloudflare itself does not send expiry emails.

aaPanel SSL tab for filecafe.site: Current Certs Deployed, Other certificate for *.filecafe.site and filecafe.site, expiring 2026-11-27, with a renewal tip.
aaPanel after the origin certificate was deployed. I took this later, during my redirect test, so Force HTTPS is on here; the key and certificate boxes are cropped out.

Leave Force HTTPS off while you set this up. In that later test I switched it on while Cloudflare was in Flexible mode and got an endless loop, as I explain in my too many redirects guide. With Full (strict) and a valid origin certificate it is safe to turn on.

On plain Nginx (no panel)

I did not run these steps on the lab server, because aaPanel did the work. They are the standard Nginx way of adding a certificate; change the paths and domain to yours.

▶ On the server (SSH terminal), as root or with sudo:

mkdir -p /etc/ssl/cloudflare
nano /etc/ssl/cloudflare/example.com.pem
nano /etc/ssl/cloudflare/example.com.key
chmod 600 /etc/ssl/cloudflare/example.com.key

What it does: makes a folder for the files, opens an empty certificate file (paste the Origin Certificate, then save with Ctrl+O, Enter, Ctrl+X), opens an empty key file (paste the Private Key, save the same way), and makes the key readable only by root. It creates new files and changes nothing else.

▶ On the server, in your site’s Nginx config file (for example nano /etc/nginx/sites-available/example.com), point the HTTPS server block at the two files:

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;

    # the rest of your site config stays as it is
}

What it does: tells Nginx to answer HTTPS on port 443 with the origin certificate. It changes how your site serves HTTPS once you reload. If the block already has ssl_certificate lines, replace their paths rather than adding a second pair. If it also has a listen 443 quic; line, leave it alone; ssl belongs on the TCP listen 443 line (and on a listen [::]:443 line, if you have one).

▶ On the server (SSH terminal), as root or with sudo:

nginx -t && systemctl reload nginx

What it does: checks the config for mistakes and reloads Nginx only if the check prints “syntax is ok” and “test is successful”. The reload keeps running connections open. If the test fails, nothing is reloaded; fix the line it names first.

Step 3: Check the certificate on the server

Before you touch Cloudflare’s mode, make sure Nginx really serves the new certificate. I ran this on the server.

▶ On the server (SSH terminal):

echo | openssl s_client -connect 127.0.0.1:443 -servername example.com 2>/dev/null | openssl x509 -noout -issuer -subject -dates
curl -sS -o /dev/null --resolve example.com:443:127.0.0.1 https://example.com/

What it does: the first line connects to the server’s own port 443 for your domain and prints who issued the certificate, its subject and its dates. The second asks the server for your homepage directly, skipping Cloudflare (--resolve sends the request to 127.0.0.1), with normal certificate checks on. Neither changes anything.

My output showed the issuer as CloudFlare Origin SSL Certificate Authority, valid from Nov 20 15:09:00 2026 GMT to Nov 27 15:09:00 2026 GMT, seven days. The direct request then failed with curl: (60) SSL certificate problem: unable to get local issuer certificate.

Server terminal: issuer CloudFlare Origin SSL Certificate Authority, valid Nov 20 to Nov 27 2026, then curl error 60 unable to get local issuer certificate.
On the server: the origin certificate is in place, and a direct request rejects it with curl error 60 (server name blurred).

That error is the expected result, not a problem. curl does not trust Cloudflare’s Origin CA, just like a browser. Together, the two lines show two things: Nginx is serving the Cloudflare certificate, and a visitor who reaches your server without Cloudflare will get a warning. The subject line reads CN = CloudFlare Origin Certificate rather than your domain; the hostnames you picked are in the certificate’s alternative names.

To see those names, ▶ on the server (SSH terminal):

echo | openssl s_client -connect 127.0.0.1:443 -servername example.com 2>/dev/null | openssl x509 -noout -ext subjectAltName

What it does: prints the hostnames the certificate covers. It changes nothing. This line is not in my screenshots; I add it because the subject line confuses people.

Step 4: Switch Cloudflare to Full (strict)

Now tell Cloudflare to check the certificate. No command is needed:

  1. In your domain, open SSL/TLS, Overview, and click Configure.
  2. Choose Custom SSL/TLS, select Full (strict), and save.
  3. Check that the overview says Current encryption mode: Full (strict).
Cloudflare SSL/TLS overview showing Current encryption mode Full (strict), with automatic mode disabled.
Full (strict) on my test domain, set after the origin certificate was in place (account email blurred).

I choose Custom on purpose. Earlier in the same lab, Automatic SSL/TLS was switched on and the zone ended up in Full (strict) while I thought it was in Full, which is how I first met error 526. My error 526 guide has the screenshots. With Custom you know which mode you are in.

Step 5: Test through Cloudflare

The last check goes through Cloudflare, exactly like a visitor.

▶ On your own computer, in Windows cmd (not PowerShell). On Mac or Linux, use curl instead of curl.exe and /dev/null instead of NUL:

curl.exe -s -o NUL -w "%{http_code} %{time_total}\n" https://example.com/

What it does: requests your homepage through Cloudflare, throws the page away and prints the status code and the total time in seconds. It changes nothing. I ran it three times in a row for a small text file on the test site.

All three returned 200, in 0.367179, 0.269769 and 0.195195 seconds. Full (strict) → 200: Cloudflare validated the origin certificate and served the file. Before the origin certificate, with the self-signed one on the same server and the same mode, all three runs returned error 526.

Windows cmd: three curl.exe requests to filecafe.site/cf-lab.txt returning 200 in 0.367179, 0.269769 and 0.195195 seconds.
Through Cloudflare in Full (strict) with the origin certificate installed: 200 three times.

My results in one table

Certificate on the serverRequestCloudflare modeResult
Self-signedThrough CloudflareFull (strict)526 (see my 526 guide)
Self-signedThrough CloudflareFull200
Cloudflare origin certificateDirect to the server, verified(not involved)curl error 60, not trusted
Cloudflare origin certificateThrough CloudflareFull (strict)200 (0.37, 0.27, 0.20 s)

The times are three quick runs from Dhaka through Cloudflare to a small test server; they show that the requests worked, not how fast your site will be.

Throwaway Ubuntu 22.04 test VPS used for the Cloudflare error lab, with 1 vCPU, about 2 GB RAM and a 25 GB disk.
The test server: Ubuntu 22.04, 1 vCPU, about 2 GB RAM, 25 GB disk (server name blurred).

Do you need the Cloudflare Origin CA root certificate?

Usually not on Nginx. Cloudflare’s docs say some origin servers need the Origin CA root certificate or chain, and offer it in two versions, RSA PEM and ECC PEM, with a note not to use the ECC one on Apache cPanel. My Nginx test returned 200 in Full (strict) with only the certificate and key that Cloudflare gave me, no root file.

If your panel or server refuses the certificate without a chain, download the root that matches your key type (RSA for an RSA certificate) from the Cloudflare Origin CA docs and add it where the panel asks for a CA bundle or chain.

You may also see Authenticated Origin Pulls mentioned next to origin certificates. That is a separate feature: Cloudflare presents its own client certificate, and your server refuses connections that do not have it. It is the other direction of trust, and I did not test it here.

What can break after you install it

I saw the first row myself, and my self-signed test in Full mode matches the second. The rest come from Cloudflare’s docs and my other Cloudflare error tests, so treat them as what to check.

What happensWhat you seeFix
Someone reaches the server without CloudflareCertificate error (curl error 60 in my test)Normal; keep the hostname proxied
Cloudflare mode is not Full (strict)Works, but Cloudflare does not check the certificateSet Full (strict)
Orange cloud turned off, or Cloudflare pausedBrowsers warn about an untrusted certificate (Cloudflare’s docs)Turn the proxy back on, or use Let’s Encrypt for that hostname
A hostname is not on the certificate (for example a.b.example.com)Error 526 in Full (strict)Create a new certificate that lists it
The certificate expiresError 526 in Full (strict); no email from CloudflareRenew before the date; note it when you create it
Nginx answers on port 443 without TLS (for example ssl missing from the listen line)Error 525, not 526See my error 525 guide
Nothing listens on port 443 (Nginx stopped)Error 521See my error 521 guide
Force HTTPS on the server while Cloudflare is in FlexibleRedirect loopUse Full (strict); see the redirect loop guide

My Cloudflare settings for WordPress guide explains why I use Full (strict), not Flexible.

How to renew or revoke a Cloudflare origin certificate

Renewing is the same as installing: create a new origin certificate, paste it over the old one in aaPanel (or replace the two files and reload Nginx), run the Step 3 and Step 5 checks, then revoke the old certificate. Cloudflare’s docs say it does not currently send expiry notifications, so put the expiry date in your calendar on the day you create the certificate.

Revoking is in SSL/TLS, Origin Server: choose the certificate and click Revoke. Cloudflare’s docs warn that you cannot undo it, and suggest moving the mode to Full or Flexible first so visitors do not get errors. At the end of my lab I set the mode back to Full and then revoked the 7-day certificate (I did not screenshot that step), and the test server was deleted afterwards.

If you revoke a certificate that a server is still using while the zone is in Full (strict), expect error 526 for that site until a new certificate is installed. Cloudflare’s 526 docs list a revoked certificate as a cause; I did not test this.

Cloudflare origin certificate FAQ

What is an origin in Cloudflare?

The origin is your own web server, the machine Cloudflare fetches your pages from. Visitors connect to Cloudflare, and Cloudflare connects to the origin. An origin certificate secures only that second connection.

Why is the Cloudflare origin certificate not trusted?

Browsers and tools like curl do not trust Cloudflare’s Origin CA, so a direct visit to your server shows a certificate error. In my test curl gave error 60, unable to get local issuer certificate. Through Cloudflare’s proxy the same certificate returned 200 in Full (strict) mode, because Cloudflare does trust it.

Should I use a Cloudflare origin certificate or Let’s Encrypt?

If every hostname on the server stays proxied (orange cloud), the origin certificate is simpler: one certificate for years, no renewal on the server. If you sometimes switch the proxy off, or want to pause Cloudflare, use Let’s Encrypt, because browsers trust it.

Is the Cloudflare origin certificate free?

Yes. I created mine on the Cloudflare Free plan, and it worked in Full (strict) mode on that plan.

How long is a Cloudflare origin certificate valid?

You choose when you create it. The creation page says the default is fifteen years; I picked 7 days for my test. Cloudflare does not email you before it expires, so note the date.

Why do I get error 526 with a Cloudflare origin certificate?

In Full (strict) Cloudflare shows 526 when it cannot validate the origin certificate: the hostname is not on it, it has expired or been revoked, or the server is still serving another certificate. Run the Step 3 openssl check to see which certificate Nginx actually serves. In my test, 526 came from the self-signed certificate that was there before.

Where do I download the Cloudflare Origin CA root certificate?

Cloudflare’s Origin CA documentation page has the root certificate in two versions, RSA PEM and ECC PEM. Most Nginx setups do not need it; my test worked without it.

Can I use a Cloudflare origin certificate without the Cloudflare proxy?

Not for visitors. If you turn the orange cloud off or pause Cloudflare, browsers connect to your server directly and see an untrusted certificate. Cloudflare’s docs warn about this.

What happens when a Cloudflare origin certificate expires?

In Full (strict) mode Cloudflare can no longer validate the origin certificate, and its error 526 page lists an expired certificate as a cause. I did not let mine expire; I revoked it. Renew it before the expiry date.

Related Guides