前提我有一个包含泛域名(*.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/{...}}问题如何不累赘(所有证书走统一路径)实现证书加载?
相关分类