我按照说明进行操作,在 Jenkins 前面使用 Apache 的反向代理不起作用。我已经设置了代理到 Jenkins 的 Apache 虚拟主机配置:
Apache 虚拟主机
<VirtualHost *:8084>
ServerAdmin emil@my_email.com
ProxyRequests Off
ProxyPass /jenkins http://localhost:8084/jenkins
ProxyPassReverse /jenkins http://localhost:8084/jenkins
<Proxy http://localhost:8084/jenkins*>
Order allow,deny
Allow from all
</Proxy>
ProxyPreserveHost on
</VirtualHost>
虚拟主机已激活,没有错误。
你可以在这里看到我对/etc/default/jenkins 的更改:
HTTP_PORT=8084
...
PREFIX=/jenkins
...
JENKINS_ARGS="--httpListenAddress=127.0.0.1 --webroot=/var/cache/jenkins/war --prefix=$PREFIX --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT"
我正在跟踪 apache 日志和 jenkins,但是当我尝试访问 http://:8084/jenkins 时,我什么也得不到,没有页面。当我不使用--httpListenAddress=127.0.0.1启动Jenkins时,我成功打开了http://:8084/jenkins,但是这是直接访问Jenkins,没有经过Apache。
知道我的反向代理配置中可能存在的问题吗?这是非常标准的。
谢谢,
埃米尔
最佳答案
我忘记在 ports.conf 中添加“Listen 8084”指令,所以 Apache 没有在那里监听。不管怎样,解决了,周五晚上不应该做设置。
关于apache - Jenkins 支持 Apache 和 mod_proxy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12644701/