小编fri*_*mle的帖子

用于 Jenkins 和 Sonar 的带有 SSL 的 Apache 反向代理配置

我在 Apache 服务器后面运行两个服务:Jenkins(端口 8080)和 SonarQube(端口 9000)。

我的 apache 配置如下所示:

<VirtualHost *:80>
  ServerName server
  Redirect permanent / https://server.domain.com/
</VirtualHost>

<VirtualHost *:80>
  ServerName server.domain.com
  Redirect permanent / https://server.domain.com/
</VirtualHost>

<VirtualHost *:443>
  ServerName server.domain.com

  SSLEngine on
  SSLCertificateFile /etc/ssl/certs/server.crt
  SSLCertificateKeyFile /etc/ssl/private/server.key

  ProxyPass        /jenkins http://localhost:8080/jenkins nocanon
  ProxyPassReverse /jenkins http://localhost:8080/jenkins
  ProxyPassReverse /jenkins http://server.domain.com/jenkins
  ProxyPassReverse /jenkins https://server.domain.com/jenkins

  ProxyPass        /sonar http://localhost:9000/sonar nocanon
  ProxyPassReverse /sonar http://localhost:9000/sonar

  AllowEncodedSlashes NoDecode
  ProxyRequests Off
  ProxyPreserveHost On
  <Proxy http://localhost:8080/*>
    Order deny,allow
    Allow from all
  </Proxy>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

一切似乎都运行良好,除了 Jenkins 抱怨此消息:您的反向代理设置似乎已损坏。

当我运行Jenkins 提供的ReverseProxySetupMonitor测试时,错误消息表明反向代理设置不正确,因为它没有用 …

ssl ssl-certificate jenkins apache-2.2 apache-2.4

12
推荐指数
1
解决办法
3万
查看次数

标签 统计

apache-2.2 ×1

apache-2.4 ×1

jenkins ×1

ssl ×1

ssl-certificate ×1