acme.sh配合nginx使用
-
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;
}
- 生成证书
acme.sh --issue -d $1 -d www.$1 -w /usr/local/nginx/html