为了账号安全,请及时绑定邮箱和手机立即绑定

萌新求教!nginx服务器上如何配置多个二级域名,然后使用统一证书?

萌新求教!nginx服务器上如何配置多个二级域名,然后使用统一证书?

蓝山帝景 2019-06-13 10:13:28
前提我有一个包含泛域名(*.example.com和example.com)的证书;我的目的nginx,所有example.com一级、二级域名都用这一个证书;实现方式方式一:验证通过,但冗余代码太多每个匹配的域名都加载证书,个人感觉太累赘了,因为证书都是同一个#example.comserver{listen443;server_nameexample.com;sslon;ssl_certificate/etc/letsencrypt/live/example.com/fullchain.pem;ssl_certificate_key/etc/letsencrypt/live/example.com/privkey.pem;location/{...}}#aaa.example.comserver{listen443;server_nameaaa.example.com;sslon;ssl_certificate/etc/letsencrypt/live/example.com/fullchain.pem;ssl_certificate_key/etc/letsencrypt/live/example.com/privkey.pem;location/{...}}#bbb.example.comserver{listen443;server_namebbb.example.com;sslon;ssl_certificate/etc/letsencrypt/live/example.com/fullchain.pem;ssl_certificate_key/etc/letsencrypt/live/example.com/privkey.pem;location/{...}}方式二:有问题!!!我想要把方式一中所有证书走统一路径,如何实现?#所有符合server_name都加载些证书server{listen443;server_name*.example.comexample.com;sslon;ssl_certificate/etc/letsencrypt/live/example.com/fullchain.pem;ssl_certificate_key/etc/letsencrypt/live/example.com/privkey.pem;}#example.comserver{listen443;server_nameexample.com;location/{...}}#aaa.example.comserver{listen443;server_nameaaa.example.com;location/{...}}#bbb.example.comserver{listen443;server_namebbb.example.com;location/{...}}问题如何不累赘(所有证书走统一路径)实现证书加载?
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 1140 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信