longzhanpeng 2020-06-19
- 百度找到的加速下载插件的方式无非是离线下载上传或者修改`升级站点`的错误方法(这些方法100%不奏效,大家要是可以的话算我输)
要点:
实操
1. 配置nginx下载源 #] cat > /etc/yum.repos.d/nginx.repo << EOF [nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true EOF 2. 安装nginx #] yum -y install nginx 3. 代理配置 #] vim /etc/nginx/conf.d/jenkins_proxy.conf server { listen 80; server_name updates.jenkins-ci.org; access_log /data/logs/nginx/jenkins_proxy.log; location /download/plugins { proxy_set_header Host mirrors.tuna.tsinghua.edu.cn; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; rewrite /download/plugins(.*) /jenkins/plugins/$1 break; proxy_pass http://mirrors.tuna.tsinghua.edu.cn; } } #] nginx && nginx -t && nginx -s reload 4. jenkins hosts配置 #] vim /etc/hosts 10.18.99.39 updates.jenkins-ci.org 5. 插件下载测试