另类姿势调整jenkins插件源

准备工作

新增hosts解析 127.0.0.1 updates.jenkins-ci.org

配置nginx

cat nginx/default.conf
server {
    listen       80;
    server_name  updates.jenkins-ci.org;
    location /download/plugins/ {
        proxy_pass https://mirrors4.tuna.tsinghua.edu.cn/jenkins/plugins/;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
    location / {
      proxy_set_header        Host $host:$server_port;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;
      # Fix the "It appears that your reverse proxy set up is broken" error.
      proxy_pass          http://127.0.0.1:8080;
      proxy_read_timeout  90;
      # Required for new HTTP-based CLI
      proxy_http_version 1.1;
      proxy_request_buffering off;
    }
}

部署

通过docker-compose 一键部署
version: '2.1'
services:
  jenkins:
    image: jenkins/jenkins:lts
    container_name: jenkins
    volumes:
      - /data/jenkins:/var/jenkins_home
      - /etc/localtime:/etc/localtime
    network_mode: host
    restart: always
  nginx:
    image: nginx
    container_name: nginx
    network_mode: host
    volumes:
      - ./nginx:/etc/nginx/conf.d
    restart: always

End

愉快的更新插件啦,嘻嘻

Last modification:September 18th, 2019 at 06:12 pm
搞技术/肝文章不易,恳请随意打赏 OwO

Leave a Comment