環(huán)境: Ubuntu 16.04 x64
由于客戶端無法通過瀏覽器直接訪問Linux 服務(wù)器,所以需要在Linux 服務(wù)器上面部署反向代理服務(wù)器,只有這樣才能找到Jenkins的服務(wù)端口. 假如jenkins 服務(wù)端口是8080,然后nginx 監(jiān)聽 80 ,反向代理8080,外部的瀏覽器就可以通過linux服務(wù)器的ip地址直接訪問jenkins 的服務(wù)網(wǎng)頁(使用http,http默認(rèn)端口是80)
1.安裝jdk1.8
2.安裝Jenkins
3.安裝Nginx
安裝簡單,nginx的配置如下:
location = / {
proxy_pass http://127.0.0.1:8080/index;
}
location / {
port_in_redirect on;
proxy_pass http://127.0.0.1:8080$request_uri;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}