题目是,今天拿到了一百个域名,要求给布置到某个服务上面。
acme.sh --issue -d furnam.com -w /www/wwwroot/yangkexin/
用到了acme.sh
furnam.com是域名, /www/wwwroot/yangkexin/是目录,
然后改nginx 配置,添加ssl即可, 批量修改成https.
nginx 里面的配置
listen 80;
listen 443 ssl http2;
server_name ouchic.com www.ouchic.com;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/yangkexin;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#HTTP_TO_HTTPS_START
if ($server_port !~ 443){
rewrite ^(/.*)$ https://$host$1 permanent;
}
#HTTP_TO_HTTPS_END
ssl_certificate /www/server/panel/vhost/cert/ouchic.com/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/ouchic.com/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
error_page 497 https://$host$request_uri;
第一步 批量执行此类代码
acme.sh --issue -d furlar.com -w /www/wwwroot/yangkexin/
acme.sh --issue -d pestmy.com -w /www/wwwroot/yangkexin/
acme.sh --issue -d pestken.com -w /www/wwwroot/yangkexin/
acme.sh --issue -d pestford.com -w /www/wwwroot/yangkexin/
acme.sh --issue -d edgken.com -w /www/wwwroot/yangkexin/
第二版, 批量替换nginx配置文件
mk.php 脚本
网友评论