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
原文地址:https://www.cnblogs.com/vinic-xxm/p/14330648.html