Apache代理未从Jenkins、Nexus和Sonarqube的正确路径提取资源

Apache代理未从Jenkins、Nexus和Sonarqube的正确路径提取资源,apache,jenkins,sonarqube,reverse-proxy,nexus,Apache,Jenkins,Sonarqube,Reverse Proxy,Nexus,我的Apache代理服务器有问题。 在我的服务器上,我有3个服务运行+apacheproxy Jenkins(端口8082)、Sonarqube(端口9000)和Nexus(端口8081) 我的Apache虚拟主机配置如下所示: <VirtualHost *:80> ServerName example.katone.com ProxyPass /jenkins http://localhost:8082 ProxyPassReve

我的Apache代理服务器有问题。 在我的服务器上,我有3个服务运行+apacheproxy Jenkins(端口8082)、Sonarqube(端口9000)和Nexus(端口8081)

我的Apache虚拟主机配置如下所示:

<VirtualHost *:80>
    ServerName example.katone.com

    ProxyPass           /jenkins    http://localhost:8082
    ProxyPassReverse    /jenkins    http://localhost:8082
    ProxyPass           /nexus      http://localhost:8081
    ProxyPassReverse    /nexus      http://localhost:8081
    ProxyPass           /sonarqube  http://localhost:9000
    ProxyPassReverse    /sonarqube  http://localhost:9000

    <Location "/jenkins">
      Require all granted
    </Location>
    <Location "/nexus">
      Require all granted
    </Location>
    <Location "/sonarqube">
      Require all granted
    </Location>
</VirtualHost>
它看错地方了。 当我将其更改为:
http://example.katone.com:9000

资源确实存在


有没有关于如何设置我的代理以查看正确路径的想法?

解决了它!哈利路亚

这就是我最后不得不做的事情(只向你展示我在Sonarqube上所做的事情,因为这是我在回复这篇文章之前所做的唯一一件事)

  • 已编辑的SonarQube conf文件:${SonarqubeDir}/conf/sonar.properties
  • 取消注释并设置2配置,如下所示,设置基本Url:
  • 库贝酒店
  • 测试以确保应用的配置正确
  • 设置baseurl后,Apache代理虚拟主机现在如下所示: (注意“localhost:9000”后面的“sonarqube”)
  • 
    ServerName example.katone.vi.com
    ...
    ...
    ProxyPass/sonarqubehttp://localhost:9000/sonarqube
    ProxyPassReverse/sonarqubehttp://localhost:9000/sonarqube
    要求所有授权
    要求所有授权
    要求所有授权
    
  • 更新VirtualHost后重新启动Apache
  • //在“${apacheDir}/bin/”中运行以下命令

    httpd-k重启

    这对我有用。我希望这对将来的人有帮助

    Loading module from “http://example.katone.com/js/vendors-main.m.8aed9dc9.chunk.js” was blocked because of a disallowed MIME type (“text/html”).
    sonarqube
    Loading module from “http://example.katone.com/js/main.m.6c3bf723.js” was blocked because of a disallowed MIME type (“text/html”).
    
    sonar.web.host=127.0.0.1
    sonar.web.context=/sonarqube
    
    stopntservice
    startntservice
    
    // No longer works
    localhost:9000
    
    // Works now because of the conf base url change
    localhost:9000/sonarqube
    
    <VirtualHost *:80>
        ServerName example.katone.vi.com
    
        ...
        ...
    
        ProxyPass           /sonarqube  http://localhost:9000/sonarqube
        ProxyPassReverse    /sonarqube  http://localhost:9000/sonarqube
    
        <Location "/jenkins">
          Require all granted
        </Location>
        <Location "/nexus">
          Require all granted
        </Location>
        <Location "/sonarqube">
          Require all granted
        </Location>
    </VirtualHost>