NGINX支持多个带SSL证书的网站同时部署在同一台服务器上

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

解决办法:重新编译nginx,添加参数:--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访问。

猜你喜欢

转载自www.cnblogs.com/hy007x/p/9720280.html