jenkins反向代理设置有误

用docker部署了jenkins之后然后反向代理了一下,点系统控制的时候就一直有红框提示,很烦,百度了一堆都说什么系统域名设置有问题,什么xxx的,完全不是

iShot2021-10-16 00.02.53.png

实际上官方已经说了解决方案,如下

set the headers X-Forwarded-Host (and perhaps X-Forwarded-Port) on the forwarded request. Jenkins will parse those headers and generate all the redirects and other links on the basis of those headers. Depending on your reverse proxy it may be easier to set X-Forwarded-Host and X-Forwarded-Port to the hostname and port in the original Host header respectively or it may be easier to just pass the original Host header through as X-Forwarded-Host and delete the X-Forwarded-Port # header from the request. You will also need to set the X-Forwarded-Proto header if your reverse proxy is changing from https to http or vice-versa.

意思就是你如果用https的代理http的要设置一个 X-Forwarded-Proto
在nginx配置里面加一条即可

proxy_set_header X-Forwarded-Proto $scheme;

通过ssh传输到服务器总是找不到

后来才知道通过配置Remove prefix移除前缀,是指源文件的前缀,真的很好奇歪果仁写这个ssh发布插件的时候怎么想的,操作起来极其古怪
iShot2021-10-16 01.55.26.png

jenkins怎么选择不同的分支进行打包

这个要用到jenkins的插件 Git Parameter,在系统配置里面把这个插件装上之后
配置如图
iShot2021-10-17 15.55.00.png
iShot2021-10-17 15.55.21.png

Last modification:October 17, 2021
If you think my article is useful to you, please feel free to appreciate