docker 部署openresty自动申请证书
VPS相关
docker 部署openresty自动申请证书
广告也精彩


docker run -d -p 80:80 -p 443:443 -v "/data/web":/data/web \
-v /data/openresty/nginx/conf/ssl:/usr/local/openresty/nginx/conf/ssl \
-v /data/openresty/nginx/conf/conf.d:/usr/local/openresty/nginx/conf/conf.d \
-v "/data/openresty/acme_cert":/acme_cert/ \
-e SslDomains="example.com;www.example.com;test.example.com;test2.example.com" \
-e SslServer="zerossl" \
-e mail="my@example.com" \
--name myopenresty xiaojun207/openresty:latest

注意:

1、建议把路径/usr/local/openresty/nginx/conf/ssl、/acme_cert/中的内容都持久化到宿主机保存,避免容器删除后,启动后会自动再次获取(频繁申请证书会被服务商限制)。
2、不要改变nginx.conf的路径,否则证书生成会失败。

from:https://github.com/xiaojun207/docker-openresty

相关导航