tengine 如何配置或者如何编译,才能支持同一个server配置多个证书?

voj3qocg  于 2022-10-25  发布在  其他
关注(0)|答案(1)|浏览(176)

配置文件

server {
  listen       443    ssl;
  server_name  www.aaa.org.cn file.aaa.org.cn;

  ssl_certificate      ../certs/www.aaa.org.cn.crt;
  ssl_certificate_key  ../certs/www.aaa.org.cn.key;
  ssl_certificate      ../certs/file.aaa.org.cn.crt;
  ssl_certificate_key  ../certs/file.aaa.org.cn.key;
  ssl_certificate      ../certs/all.pem;
  ssl_certificate_key  ../certs/all.key; 

  ssl_session_cache    shared:SSL:1m;
  ssl_session_timeout  5m; 
  ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_prefer_server_ciphers on; 
}

这么配置的话,只有最后一个证书生效,上面两个证书都不生效了。

kmynzznz

kmynzznz1#

配置多个server,每个server一个域名,一个证书。

server {
  listen       443    ssl;
  server_name  www.aaa.org.cn;

  ssl_certificate      ../certs/www.aaa.org.cn.crt;
  ssl_certificate_key  ../certs/www.aaa.org.cn.key;
}
server {
  listen       443    ssl;
  server_name  file.aaa.org.cn;

  ssl_certificate      ../certs/file.aaa.org.cn.crt;
  ssl_certificate_key  ../certs/file.aaa.org.cn.key;
}

相关问题