Jenkins看起来您的反向代理设置已损坏。

时间:2018-04-27 09:17:26

标签: jenkins proxy

此问题已经发布,我只有一个问题。

Stackoverflow的建议是:

  

确保在系统配置中配置了Jenkins URL   匹配您用于访问Jenkins的URL。

进入系统配置:

Go to your Jenkins page
Click Manage Jenkins
Click Configure System
Scroll to Jenkins Location and find Jenkins URL.

确保端口值与计算机上Jenkins文件夹中jenkins.xml文件部分中设置的端口值匹配。

我查看了配置系统中的URL,然后打开了我的jenkins.xml。但我没有在我的jenkins.xml文件中看到任何URL,我应该在哪里添加它?在任何地方,如<argument>http://jenkins.subdomain.com/</argument>

我的詹金斯档案是:

<?xml version='1.1' encoding='UTF-8'?>
<hudson>
  <disabledAdministrativeMonitors/>
  <version>2.107.2</version>
  <installState>
    <isSetupComplete>true</isSetupComplete>
    <name>RUNNING</name>
  </installState>
  <numExecutors>2</numExecutors>
  <mode>NORMAL</mode>
  <useSecurity>true</useSecurity>
  <authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">
    <denyAnonymousReadAccess>true</denyAnonymousReadAccess>
  </authorizationStrategy>
  <securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
    <disableSignup>true</disableSignup>
    <enableCaptcha>false</enableCaptcha>
  </securityRealm>
  <disableRememberMe>false</disableRememberMe>
  <projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/>
  <workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}</workspaceDir>
  <buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
  <jdks/>
  <viewsTabBar class="hudson.views.DefaultViewsTabBar"/>
  <myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/>
  <clouds/>
  <quietPeriod>5</quietPeriod>
  <scmCheckoutRetryCount>0</scmCheckoutRetryCount>
  <views>
 <hudson.model.AllView>
      <owner class="hudson" reference="../../.."/>
      <name>all</name>
      <filterExecutors>false</filterExecutors>
      <filterQueue>false</filterQueue>
      <properties class="hudson.model.View$PropertyList"/>
    </hudson.model.AllView>
  </views>
  <primaryView>all</primaryView>
  <slaveAgentPort>-1</slaveAgentPort>
  <disabledAgentProtocols>
    <string>JNLP-connect</string>
    <string>JNLP2-connect</string>
  </disabledAgentProtocols>
  <label></label>
<crumbIssuer class="hudson.security.csrf.DefaultCrumbIssuer">
    <excludeClientIPFromCrumb>false</excludeClientIPFromCrumb>
  </crumbIssuer>
  <nodeProperties/>
  <globalNodeProperties>
    <hudson.slaves.EnvironmentVariablesNodeProperty>
      <envVars serialization="custom">
        <unserializable-parents/>
        <tree-map>
          <default>
            <comparator class="hudson.util.CaseInsensitiveComparator"/>
          </default>
          <int>1</int>
          <string>ACR_LOGINSERVER</string>
          <string>containerregistryah.azurecr.io</string>
           </tree-map>
      </envVars>
    </hudson.slaves.EnvironmentVariablesNodeProperty>
  </globalNodeProperties>
</hudson>

1 个答案:

答案 0 :(得分:0)

Apache Configuration应该具有ProxyPass的规范。如果启用了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