nginx 配置https upstream 跳转失败

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

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

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

 server {
listen ;
listen 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;
上一篇:Mac环境下扩容 .vmdk 镜像容量


下一篇:Dubbo 源码解析四 —— 负载均衡LoadBalance