Nginx443端口绑定多域名

Nginx443绑定多域名

1. 修改nginx的配置文件

server 
   {
        # 基于域名的虚拟主机
        listen       443  ssl;
        server_name test1.abc.com;
        ssl_certificate      /home/nginx/ssl/test1.abc.com.pem;
        ssl_certificate_key  /home/nginx/ssl/test1.abc.com.key;
        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;
}

server 
   {
        # 基于域名的虚拟主机
        listen       443 ssl;
        server_name  test2.abc.com;
        ssl_certificate      /home/nginx/ssl/test2.abc.com.pem;
        ssl_certificate_key  /home/nginx/ssl/health.kp-china.com.key;
        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;
}

2. 重启nginx

/usr/local/nginx/sbin/nginx -s reload

你可能感兴趣的:(部署运维,网络)