jenkins插件加速,使用清华地址

一,安装完并完成管理员配置后

1.进入jenkins系统管理
2.进入插件管理(Manage Plugins)——高级——升级站点

  

image.png



二,在jenkins服务器上下载安装nginx,做个虚拟主机的转发

$ grep jenkins /etc/hosts
### jenkins ###
127.0.0.1 mirrors.jenkins-ci.org




nginx安装目录的conf.d/mirrors.jenkins-ci.org.conf

  root@tangtang:/etc/nginx/conf.d#cat mirrors.jenkins-ci.org.conf


server
    {
        listen 80;
        server_name mirrors.jenkins-ci.org;

        location / {
            proxy_redirect off;
            proxy_pass https://mirrors.tuna.tsinghua.edu.cn/jenkins/;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Accept-Encoding "";
            #proxy_set_header User-Agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.49 Safari/537.36";
            proxy_set_header Accept-Language "zh-CN";
        }
        index index.html index.htm index.php;

        #error_page   404   /404.html;

        location ~ /\.
        {
            deny all;
        }

        access_log  /data/weblog/xx.access.log;
        error_log   /data/weblog/xx.error.log;
    }

root@tangtang:/etc/nginx/conf.d# mkdir /data/weblog

猜你喜欢

转载自blog.51cto.com/14240018/2484930