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