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;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM