【问题标题】:NGINX proxy http://host/jenkins to http://host:8080NGINX 代理 http://host/jenkins 到 http://host:8080
【发布时间】: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/;
}

【问题讨论】:

    标签: nginx jenkins


    【解决方案1】:

    确保更新您的 Jenkins 配置

    JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --prefix=/jenkins"

    取自https://wiki.jenkins.io/display/JENKINS/Jenkins+behind+an+NGinX+reverse+proxy

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-28
      • 2014-02-05
      • 2020-08-09
      相关资源
      最近更新 更多