一般情況下,同一台服務器上如果要配置多個帶有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,有疑問的同學可直接聯系。