一个ip对应多个域名多个ssl证书配置-Nginx实现多域名证书HTTPS,NGINX支持多个带SSL证书的网站同时部署在同一台服务器上

一般情况下,同一台服务器上如果要配置多个带有SSL证书的https网站,那么网站的端口号不能相同,要不然两个站点有可能会冲突(使用tls协议),造成不能同时访问。

如要完美解决,方法如下:

重新编译nginx,在 ./configure 中添加参数:--with-openssl-opt="enable-tlsext" 即可解决。

如:
./configure --prefix=/usr/local/nginx --user=nobody --group=nobody --with-http_v2_module --with-http_gzip_static_module --with-http_realip_module --with-http_stub_status_module
--with-http_ssl_module --with-pcre --with-openssl-opt="enable-tlsext"

这样,所有站点都可以同时用80和443访问。

本人微信:weixin-hu-yin,有疑问的同学可直接联系。

原文地址:https://www.cnblogs.com/hy007x/p/9720280.html