【发布时间】:2018-03-28 15:29:28
【问题描述】:
我尝试使用 NGINX 作为我的 Jenkins 服务器的反向代理。基本上当http://host/jenkins 在浏览器中打开时,NGINX 应该将请求代理到 Jenkins 正在侦听的http://host:8080。
我尝试了各种不同的配置,但没有一个真正有效。这里是我目前使用的位置配置。它以某种方式工作,但不显示任何图像等。
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/;
}
【问题讨论】: