【问题标题】:Jenkins reverse proxy setup is brokenJenkins 反向代理设置被破坏
【发布时间】:2016-10-17 04:42:04
【问题描述】:

我不知道为什么 Jenkins 更新到版本 1.642.4 (Ubuntu Server 15.04) 后,原来正确设置的反向代理现在坏了。我当前的设置与 Jenkins wiki 中所说的完全相同:

    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass / http://localhost:9090/ nocanon
    ProxyPassReverse / http://localhost:9090/
    AllowEncodedSlashes NoDecode

    # Local reverse proxy authorization override
    # Most unix distribution deny proxy by default (ie /etc/apache2/mods-enable$
    <Proxy http://localhost:9090/*>
       Order deny,allow
       Allow from all
    </Proxy>

【问题讨论】:

  • 已解决。在 Jenkins 位置设置中添加了正确的 URL
  • 怎么样? url 的预期形式是什么?
  • Manage Jenkins > Configure System > 找到Jenkins Location,有输入Jenkins URL。请添加网址。我添加了http://jenkins.subdomain.com/,与我在浏览器中使用的相同

标签: jenkins reverse-proxy


【解决方案1】:

Apache 配置应该有用于 ProxyPass 的 nocanon。如果启用 SSL,则必须设置 X-Forwarded-Proto 和 X-Forwarded-Port。

ProxyPass               / http://localhost:8080/ nocanon
AllowEncodedSlashes     NoDecode
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

您需要将以下内容添加到 Tomcat 中的 catalina.properties 文件中。更新 Apache 配置本身是不够的。

org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-01-25
    • 1970-01-01
    • 2012-03-19
    • 2017-02-07
    • 2016-07-05
    • 1970-01-01
    相关资源
    最近更新 更多