HTTPS deployment practices (let ' s Encrypt)

Source: Internet
Author: User
Tags letsencrypt

1. Get let ' s Encrypt
clone https://github.com/letsencrypt/letsencryptcd letsencryptchmod +x letsencrypt-auto
2. Execute Installation Certificate
-a webroot --webroot-path=/home/www/demo.com --email [email protected] -d -d www.demo.com

Replace directories, mailboxes, and domain names with your own
It means the installation certificate is successful!
and can see the directory of the certificate:
/etc/letsencrypt/live/demo.com

There are four files in this directory

cert.pem  - Apache 服务器端证书  chain.pem - Apache 根证书和中继证书 fullchain.pem - Nginx 所需要 ssl_certificate 文件 privkey.pem - 安全证书 KEY 文件 
3. Modify Nginx configuration file

Open nginx config file, mine is: /usr/local/nginx/conf/vhost/default.conf .
To modify a record:

server {

listen 80;

server_name localhost;
Return 301 https://$server _name$request_uri;

}



ssl.conf 中:

ssl_certificate /etc/letsencrypt/live/demo.com/fullchain.pem;

ssl_certificate_key /etc/letsencrypt/live/demo.com/privkey.pem;


After saving, restart Nginx

HTTPS deployment practices (let ' s Encrypt)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.