我在本地计算机上安装了 jenkins。可用的本地主机:8080。我想配置为能够从 localhost/jenkins 访问 Jenkins
我尝试将其放入我的 000-default.conf 中:
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
为了让 /jenkins 转到 jenkins,然后 / 转到 apache 起始页,您需要更新您的 proxy 和 proxyPass 行:
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass /jenkins http://127.0.0.1:8080/jenkins
ProxyPassReverse /jenkins http://127.0.0.1:8080/jenkins
</VirtualHost>
有关您需要执行的操作的完整信息,请参阅:https://wiki.jenkins-ci.org/display/JENKINS/Running-Jenkins-behind-Apache.html