How to config the free https on Nginx

Recently, I bought an Aliyun server in the Double 11, I want to bind my web domain, but as you know, under the Chinese policy, we have to fill a complicated application. but I found that I can use https to breaking the block. so how to config the free https on Nginx?

At first, we should have a domain. then click this link

https://www.sslforfree.com/

we choose the Manual Verification because it is the easiest way. we only have to fill some information on the dashboard and add a txt record for it, following the step.

the purpose is to verify you are the owner of the domain.

then click next. Download SSL Certificate.

we got 3  encoded text.

ssh to your Nginx config.

 

 

mkdir /etc/nginx/ssl
cd /etc/nginx/ssl
vi certificate.crt

copy the Certificate content, pasted the content into the file and save it

vi private.key

copy the Private Key content, pasted the content into the file and save it

vi ca_bundle.crt

copy the CA Bundle content, pasted the content into the file and save it

combine the certificate.crt and the ca_bundle

cat certificate.crt ca_bundle.crt >> ca_chain.crt

the next, edit the Nginx config.
add a server node like this

run:   nginx -t , if it is ok, then run: server nginx restart,

Finally you can use https to visit your website.

https://zheer.me

Leave a Reply

Your email address will not be published. Required fields are marked *