根据我的搜索,我遇到了一个似乎相当常见的问题,但是我已按照我遇到的所有说明和/或修复进行操作,但没有一个对我有用,所以我问这个希望有人可以引导我走向正确的方向。
我在 OS X 10.11.2 上通过 Homebrew 安装了 Jenkins 1.644。我跟着these https://nickcharlton.net/posts/installing-jenkins-osx-yosemite.html有关如何在 OS X Server 5.0.15 网站内安装和设置的说明(我相信此版本的 OS X 服务器正在运行 Apache 2.4.16。
问题:当我连接到 Jenkins 中的管理控制台时,收到错误消息“您的反向代理设置似乎已损坏”。和一个链接这个詹金斯医生 https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache.
Hitting http://127.0.0.1:8080/管理 http://127.0.0.1:8080/manage不会产生错误。
我已将代理设置添加到我的虚拟主机文件中,如下所示:
ProxyRequests Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/ nocanon
ProxyPassReverse / http://localhost:8080/
ProxyPassReverse / http://jenkins.exampledomain.com/
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
当我进行测试卷曲时:
curl -iLk -e https://jenkins.exampledomain.com/manage \
https://jenkins.exampledomain.com/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test
我得到以下结果:
HTTP/1.1 302 Found
Date: Fri, 22 Jan 2016 06:30:57 GMT
Server: Jetty(winstone-2.9)
X-Content-Type-Options: nosniff
Location: https://jenkins.exampledomain.com/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https%3A%2F%2Fjenkins.exampledomain.com%2Fmanage/
Content-Length: 0
MS-Author-Via: DAV
HTTP/1.1 404 Not Found
Date: Fri, 22 Jan 2016 06:30:57 GMT
Server: Apache/2.4.16 (Unix) OpenSSL/0.9.8zg
Content-Length: 325
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https://jenkins.exampledomain.com/manage/ was not found on this server.</p>
</body></html>
显然该地址在此服务器上,因为我可以通过正确的地址进入管理控制台。
我陷入困境... Apache 配置不是我的强项。我正在寻找任何帮助。
--编辑更多信息--
从 /Library/Server/Web/Config/apache2/sites 目录添加完整的虚拟主机文件以获取更多详细信息。
<VirtualHost 127.0.0.1:34543>
ServerName https://jenkins.exampledomain.com:443
ServerAdmin [email protected] /cdn-cgi/l/email-protection
DocumentRoot "/Library/Server/Web/Data/Sites/jenkins.exampledomain.com"
DirectoryIndex index.html index.php default.html
CustomLog /var/log/apache2/access_log combinedvhost
ErrorLog /var/log/apache2/error_log
<IfModule mod_ssl.c>
SSLEngine On
SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
SSLProtocol -ALL +TLSv1
SSLProxyEngine On
SSLCertificateFile "/etc/certificates/machine.local.certCA1FileLocation.pem"
SSLCertificateKeyFile "/etc/certificates/machine.local.certCA2FileLocation.key.pem"
SSLCertificateChainFile "/etc/certificates/machine.local.certCA3FileLocation.chain.pem"
SSLProxyProtocol -ALL +TLSv1
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
</IfModule>
<Directory "/Library/Server/Web/Data/Sites/jenkins.exampledomain.com">
Options All -Indexes -ExecCGI -Includes +MultiViews
AllowOverride None
<IfModule mod_dav.c>
DAV Off
</IfModule>
<IfDefine !WEBSERVICE_ON>
Require all denied
ErrorDocument 403 /customerror/websitesoff403.html
</IfDefine>
</Directory>
ProxyRequests Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/ nocanon
ProxyPassReverse / http://localhost:8080/
ProxyPassReverse / http://jenkins.exampledomain.com/
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
</VirtualHost>
--编辑 2 另一个发现--
我注意到,通过尝试卷曲到上面的“未找到”网址,服务器确实报告未找到它。如果我打https://jenkins.exampledomain.com/manage/ https://jenkins.exampledomain.com/manage/我会得到 404。但是,如果我省略尾随 /,它就会起作用。https://jenkins.exampledomain.com/manage https://jenkins.exampledomain.com/manage是成功的。希望这对某人有意义!
Thanks