1. Run the following command

curl https://get.acme.sh | sh
Copy the code

If the following error is reported:Add the following configuration to hosts,

140.82.114.4 github.com 185.199.108.153 lot. The lot. IO 199.232.69.194 199.232.28.133 at github.global.ssl.fastly.net raw.githubusercontent.comCopy the code

Then re-execute the command:Check the contents of the ~/.acme.sh/ directory:

The computer suddenly ran out of power and shut down. Many interface screenshots could not be taken.

2. Run the following command

Export Ali_Key="123" export Ali_Secret=" ABC "# 2 Acme. sh --issue -- DNS dns_ali -d testdomain.com -d *.testDomain.com # 3. Install the certificate. / acme. Sh - installcert - d \ testdomain.com - key - the file/usr/local/nginx/ssl/testdomain.com.key \ - fullchain - file /usr/local/nginx/ssl/fullchain.cer \ --reloadcmd "/usr/local/nginx/sbin/nginx -s reload"Copy the code

3. Configure Nginx

/usr/local/nginx/ssl is the file that stores the HTTPS certificate. Then configure nginx.conf

server { listen 80; server_name admin.testdomain.com; return 301 https://m.testdomain.com$request_uri; } server { listen 443 ssl; server_name admin.testdomain.com; ssl_certificate /usr/local/nginx/ssl/fullchain.cer; ssl_certificate_key /usr/local/nginx/ssl/testdomain.com.key; #ssl_prefer_server_ciphers on; Ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #ssl_session_cache shared:SSL:50m; ssl_session_timeout 5m; add_header Strict-Transport-Security max-age=60; . }Copy the code