Enable CloudFlare SSL in NGINX

Hello, I have a webserver running on NGINX. Right now the only port opened is 80, as to open the HTTPS port, I need to have a certificate. The thing is that I’d like to keep the CloudFlare cert as It’s better than having an auto signed one. Thus, what do I need to do to enable HTTPS port with CloudFlare cert?

Just in case, that’s what NGINX require:

server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate www.example.com.crt;
ssl_certificate_key www.example.com.key;
}

Hope someone with more experience can help me!
Regards

Just change the value of these two settings to point to the path of your public key and private key.

1 Like

Hello erictung!

Yes, I know I need to change the paths, but I DON’T have any certificate in my VPS, I only have a flexible one, that’s why I’m asking what should I do to have a full protection with Cloudflare.

Regards!

First generate the certificate by following the instruction here:

Then copy the cert to your server and perform the Nginx configuration changes as mentioned.

2 Likes

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