Let’s Encrypt 是互联网安全研究组织 (ISRG) 提供的免费证书认证机构。它提供了一种轻松自动的方式来获取免费的 SSL/TLS 证书 - 这是在 Web 服务器上启用加密和 HTTPS 流量的必要步骤。获取和安装证书的大多数步骤可以通过使用名为 Certbot 的工具进行自动化。 -- Giuseppe Molica
本文导航
-什么是 Let’s Encrypt …… 01%
-安装 Certbot …… 12%
-获得证书 …… 22%
-在 NGINX 上配置 SSL/TLS …… 62%
-总结 …… 87%
编译自: https://www.unixmen.com/encryption-secure-nginx-web-server-ubuntu-16-04/
作者: Giuseppe Molica
译者: geekpi
# add-apt-repository ppa:certbot/certbot
# apt-get update
# apt-get install certbot
# $EDITOR /etc/nginx/sites-available/default
location ~ /.well-known {
allow all;
}
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# systemctl restart nginx
# certbot certonly --webroot --webroot-path=/var/www/html -d www.example.com
# $EDITOR /etc/nginx/snippets/secure-example.conf
ssl_certificate /etc/letsencrypt/live/domain_name/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain_name/privkey.pem;
# $EDITOR /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name www.example.com
return 301 https://$server_name$request_uri;
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
include snippets/secure-example.conf
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
# ...
}
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
欢迎光临 51学通信论坛2017新版 (http://bbs.51xuetongxin.com/) | Powered by Discuz! X3 |