首页 > Web开发 > 详细

nginx 配置https upstream 跳转失败

时间:2016-12-30 18:17:56      阅读:1994      评论:0      收藏:0      [点我收藏+]



访问首页没问题,但是在登录跳转重定向时域名被修改成upstream的名字

如果需要跳转的话会出现下面的情况:

http://test-xxx-emove_pools/beehive/index

 server {
    listen 80;
    listen 443 ssl;
    server_name test-xxxx-emove.xxxxxx.com;
    ssl on;
    ssl_certificate /etc/cert/xxxxx3.pem;
    ssl_certificate_key /etc/cert/xxxx3.key;
    ssl_session_cache shared:SSL:1m;
    #ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
    ssl_prefer_server_ciphers on;
    location / {
        proxy_pass http://test-xxxxx-emove_pools;
#增加下面内容
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

    }
 }

 经测试只要加一个参数就可以实现上面的功能:

proxy_set_header   Host             $host;

nginx 配置https upstream 跳转失败

原文:http://www.cnblogs.com/bass6/p/6237552.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!