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