如果不是自签证书 需要先合并证书
cat www.example.com.crt bundle.crt > www.example.com.chained.crt
对于单个站点(需要注意服务器防火墙是否允许访问443)
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate www.example.com.chained.crt;
ssl_certificate_key www.example.com.key;
...
}
https和http
server {
listen 80;
listen 443 ssl;
server_name www.example.com;
ssl_certificate www.example.com.chained.crt;
ssl_certificate_key www.example.com.key;
...
}