nginx https认证

98 阅读1分钟

通过CertBot为nginx配置https。

先配置nginx

server {
    server_name  taobao.yooxinz.com;

    location / {
       proxy_pass http://localhost:8080;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

安装下载certbot

CentOS/RHEL 7

sudo yum install certbot python2-certbot-nginx

其他版本

前往certbot官网

生成证书

sudo certbot --nginx