我尝试将nginx用作詹金斯服务器的反向代理。基本上,当http://http://host/jenkins在浏览器nginx中打开时,应将请求委托给http://host:8080 jenkins正在听。
我尝试了各种不同的配置,但没有任何作用。在这里,我目前使用的位置配置。它以某种方式有效,但不显示任何图像等。
location /jenkins/ {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8080/;
proxy_read_timeout 90s;
# Fix potential "It appears that your reverse proxy set up is broken" error.
proxy_redirect http://localhost:8080/ https://host/jenkins/;
}
确保更新您的Jenkins Configuration
JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --prefix=/jenkins"
取自https://wiki.jenkins.io/display/jenkins/jenkins behind behind nginx reverse reverse proxy