Jenkins 通過nginx使用Https協議反向代理


Jenkins 反向代理Https


問題描述

使用nginx 對Jenkins做反向代理,nginx使用https協議,Jenkins使用http訪問,用https://jenkins.com 訪問可以正常進入首頁,在首頁里點擊其他功能頁時,跳轉會自動請求協議為http的協議。所以我們需要將跳轉其他功能頁時,使用的協議也修改為https。

解決方式

需要在nginx配置中加入 proxy_set_header X-Forwarded-Proto $scheme; 這個請求頭。

        location / {
                proxy_set_header X-Rea $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-Nginx-Proxy true;
                proxy_pass http://localhost:3083;
                proxy_set_header X-Forwarded-Proto $scheme;
       }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM