curl https://get.acme.sh | sh
安裝成功後執行 source ~/.bashrc
以確保腳本所設置的命令別名生效nginx
若是安裝報錯,那麼多是由於系統缺乏 acme.sh 所須要的依賴項,acme.sh 的依賴項主要是 netcat(nc),咱們經過如下命令來安裝這些依賴項,而後從新安裝一遍 acme.sh:bash
sudo apt-get -y install netcat
sudo apt-get -y install socat
sudo ~/.acme.sh/acme.sh --issue -d wechatrobot.doodl6.com --standalone -k ec-256 --force
手動更新 ECC 證書session
sudo ~/.acme.sh/acme.sh --renew -d wechatrobot.doodl6.com --force --ecc
sudo ~/.acme.sh/acme.sh --installcert -d wechatrobot.doodl6.com --fullchainpath /etc/encrypt/wechatrobot.doodl6.com.crt --keypath /etc/encrypt/wechatrobot.doodl6.com.key --ecc --force
server{ listen 443 ssl; server_name wechatrobot.doodl6.com charset UTF-8; ssl on; ssl_certificate /etc/encrypt/wechatrobot.doodl6.com.crt; ssl_certificate_key /etc/encrypt/wechatrobot.doodl6.com.key; ssl_session_timeout 5m; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host wechatrobot.doodl6.com; } } server { listen 80; server_name wechatrobot.doodl6.com; rewrite ^(.*)$ https://$host$1 permanent; }