nginx 配置https upstream 跳转失败



访问首页没问题,但是在登录跳转重定向时域名被修改成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;
posted @ 2016-12-30 16:48  bass  阅读(5082)  评论(0编辑  收藏  举报