acme.sh配合nginx使用

  1. 下载安装
    https://github.com/acmesh-official/acme.sh

  2. nginx配置

server {
        listen  80 default_server;
        root /usr/local/nginx/html;
        location / {
                return 404;
        }
        location ^~ /.well-known/acme-challenge/ {
                default_type "text/plain";

        }

        location = /.well-known/acme-challenge/ {
                return 404;
        }
  1. 生成证书
    acme.sh --issue -d $1 -d www.$1 -w /usr/local/nginx/html
posted @ 2021-01-26 15:35  达芬奇vinic  阅读(370)  评论(0编辑  收藏  举报