以下是我的设置:
Jenkins master运行在服务器上,假设它的域名是jenkins.master.host,即直接访问Jenkins master的URL是http://jenkins.master.host:8080
Apache HTTPD 运行在不同的服务器上,假设它的域名是 jenkins.master.proxy。 HTTPD 配置为侦听端口 80 并代理到 jenkins master,即通过 apache 访问 Jenkins master,使用 URL http://jenkins.master.proxy。
<jnlp codebase="http://jenkins.master.proxy/computer/TestSlave/" spec="1.0+">
<information>
<title>Agent for TestSlave</title>
<vendor>Jenkins project</vendor>
<homepage href="https://jenkins-ci.org/"/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.7+"/>
<jar href="http://jenkins.master.proxy/jnlpJars/remoting.jar"/>
<property name="hudson.showWindowsServiceInstallLink" value="true"/>
</resources>
<application-desc main-class="hudson.remoting.jnlp.Main">
<argument>*******************************************</argument>
<argument>TestSlave</argument>
<argument>-url</argument>
<argument>http://jenkins.master.proxy/</argument>
</application-desc>
</jnlp>
Apache HTTPD 配置如下:
<VirtualHost *:80>
ServerName jenkins.master.proxy
ProxyPass / http://jenkins.master.host:8080/ nocanon Keepalive=On
ProxyPassReverse / http://jenkins.master.host:8080/
AllowEncodedSlashes On
ErrorLog logs/jenkins/error.log
</VirtualHost>
是否需要将一些配置放入 Jenkins master 或 apache HTTPD 中才能让从属设备连接?小 Jenkins 从属代理窗口仍然停留在“连接到 jenkins.master.proxy:9020 (重试:11)”上。也许我需要在 apache HTTPD 中添加另一个 VirtualHost 来监听端口 9020?我尝试过这样做,但没有成功。想法将不胜感激。