码迷,mamicode.com
首页 > Web开发 > 详细

Nginx多个域名,https redirect to http

时间:2017-01-04 20:36:12      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:文件中   问题:   tac   lis   tps   ica   背景   文件   http   

背景描述:Nginx绑定多个域名,其中一个域名配置了https,如域名A:https://www.aaa.com;另外的域名B(http://www.bbb.com)没有配置SSL证书,

问题:以https方式访问B域名https://www.bbb.com的时候,默认跳转到A域名:https://www.aaa.com

 

解决方式1:在B网站的配置文件中配置443端口的监听,结果会跳转的nginx的欢迎页面;

server {

     listen *:443 ssl;

     server_name www.bbb.com;

     ssl_certificate server_sha2.crt;

     ssl_certificate_key server.key;

    }

技术分享

解决方式2:替换nginx默认页面,个性化展示。(待续)

 

Stackoverflow的解决方式:

http://stackoverflow.com/questions/3470290/nginx-redirect-https-to-http

Nginx多个域名,https redirect to http

标签:文件中   问题:   tac   lis   tps   ica   背景   文件   http   

原文地址:http://www.cnblogs.com/looye-5/p/6249977.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!