部分站點因爲使用了大量的域名,會致使 auto-ssl 配置的內存不夠用,致使證書申請失敗。須要作如下調整nginx
nginx.conf 中 lua_shared_dict auto_ssl 調整爲 128m, lua_shared_dict auto_ssl_settings 調整爲 16m.web
lua_shared_dict auto_ssl 128m;
lua_shared_dict auto_ssl_settings 16m;
相關的 ssl 虛擬主機文件中將 ssl_session_cache 調整爲 128msession
[root@cpcp-web sites-enabled]# grep '128m' *-ssl.conf
admin-ssl.conf: ssl_session_cache shared:SSL:128m;
cpcp-ssl.conf: ssl_session_cache shared:SSL:128m;
調整以後 reload nginx, 若是再次 curl 的時候,仍然申請不到證書,查看 error log 中若是有如下的錯誤:dom
2017/08/11 11:26:28 [warn] 18522#18522: *1035 [lua] lets_encrypt.lua:57: issue_cert(): auto-ssl: dehydrated succeeded, but certs still missing from storage - trying to manually copy - domain: 77073.net, context: ssl_certificate_by_lua*, client: 202.131.84.134, server: 0.0.0.0:443curl
說明以前申請的證書相關的文件不完整,刪除 /etc/resty-auto-ssl/letsencrypt/certs/ 下對應的目錄後從新嘗試。lua