Nginx Acme Free Certificate Application

acme.shsupports a very large number of DNS providers, making free wildcard certificates very convenient!
Install acme.sh First
git clone https://github.com/acmesh-official/acme.sh.git
cd acme.sh/
Common APIs
Choose parameters based on your DNS provider.
--dns dns_cf(Cloudflare) /--dns dns_dp(DNSPod/Tencent) /--dns dns_ali(Aliyun)
## CloudFlare
export CF_Token="your_token"
export CF_Zone_ID="your_zone_id"
## DNSPod
export DP_Id="your_id"
export DP_Key="your_key"
## Aliyun
export Ali_Key="your_access_key_id"
export Ali_Secret="your_access_key_secret"
How to Get Common API Keys
DNSPod (Tencent Cloud)
Obtain key: Avatar -> My Account -> Account Center -> API Key -> DNSPod Token -> Create Key
Aliyun
Note: Aliyun DNS requires specific permissions!
Steps:
Go to
https://ram.console.aliyun.com/users, add a user. SelectUse permanent AccessKey for accessto createAccessKey IDandAccessKey Secret.Save the
AccessKey IDandAccessKey Secretsecurely. You can regenerate them if lost, but do not leak them.For the newly added user, click
Add Permissionand search forAliyunDNSFullAccess. This policy grants permission to manage Alibaba Cloud DNS.
Start Applying for the Certificate
You can apply for multiple domains, subdomains, wildcards, and even multiple wildcard subdomains in one command. For example:
Multiple domains:
-d zhuihoude.cn -d zhuihoude.comMultiple wildcard domains:
-d *.zhuihoude.cn -d *.zhuihoude.comMultiple wildcard subdomains:
-d *.d.zhuihoude.cn -d *.d.zhuihoude.com
./acme.sh --issue \
--server zerossl --dns dns_dp --ecc --keylength ec-384 \
-d zhuihoude.cn -d zhuihoude.com -d *.zhuihoude.cn -d *.zhuihoude.com \
-d *.d.zhuihoude.cn -d *.d.zhuihoude.com \
--accountemail admin@zhuihoude.com
Available parameters
## Choose DNS provider
--dns dns_cf # Cloudflare
--dns dns_dp # DNSPod
--dns dns_ali # Aliyun
## Choose key type and length
--rsa --keylength 4096
--ecc --keylength ec-384
## Choose certificate authority (CA)
--server letsencrypt
--server zerossl
--server buypass
--server buypassgo
After Application Completion
It is recommended to use
fullchain.cerand your domain's.keyfile as they contain the full certificate chain.Example output after successful application:
[Fri Feb 21 11:59:36 CST 2025] Your cert is in: /root/.acme.sh/zhuihoude.cn_ecc/zhuihoude.cn.cer
[Fri Feb 21 11:59:36 CST 2025] Your cert key is in: /root/.acme.sh/zhuihoude.cn_ecc/zhuihoude.cn.key
[Fri Feb 21 11:59:36 CST 2025] The intermediate CA cert is in: /root/.acme.sh/zhuihoude.cn_ecc/ca.cer
[Fri Feb 21 11:59:36 CST 2025] And the full-chain cert is in: /root/.acme.sh/zhuihoude.cn_ecc/fullchain.cer
Other: Synology Dynamic DDNS
Synology's built-in DDNS supports wildcard domains. However, the frontend interface blocks submissions containing the
*symbol. You can directly POST to the backend (GET might also work).
Post to API endpoint: https://DSM:5001/webapi/entry.cgi
## First, capture the necessary Request Headers from browser F12 (three are usually enough)
x-requested-with:XMLHttpRequest
x-syno-hash:GrkQhxoP31TF4g-1ii_6Qzz-oYc2_g.MTY0
x-syno-token:xYlNn9NhDQgtA
#### Post Form Data (you can copy the exact parameters from browser F12 and just modify the domain name)
#### Tools like the Chrome extension Postwoman can be used to send the request.
stop_when_error:true
mode:"sequential"
compound:[{"api":"SYNO.Core.DDNS.Record","method":"set","version":1,"id":"DNSPod.cn","enable":true,"provider":"DNSPod.cn","hostname":"*.zhuihoude.cn","username":"your_dnspod_id","net":"DEFAULT","ip":"124.227.92.77","ipv6":"0:0:0:0:0:0:0:0","heartbeat":false,"passwd":"your_dnspod_key"},{"api":"SYNO.Core.DDNS.Record","method":"update_ip_address","version":1,"id":"DNSPod.cn"}]
api:SYNO.Entry.Request
method:request
version:1