通过nginx代理镜像源方式
nginx使用端口
本地地址:172.16.99.110
server {
listen 8080;
#server_name 127.0.0.1;
#charset koi8-r;
#access_log logs/host.access.log main;
location /iso/ {
proxy_pass https://mirrors.aliyun.com/;
}
location /epel {
proxy_pass https://mirrors.aliyun.com/;
}
}
repo参考
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - 172.16.99.110:8080/iso
failovermethod=priority
baseurl=http://172.16.99.110:8080/iso/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://172.16.99.110:8080/iso/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates - 172.16.99.110:8080/iso
failovermethod=priority
baseurl=http://172.16.99.110:8080/iso/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://172.16.99.110:8080/iso/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 172.16.99.110:8080/iso
failovermethod=priority
baseurl=http://172.16.99.110:8080/iso/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://172.16.99.110:8080/iso/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 172.16.99.110:8080/iso
failovermethod=priority
baseurl=http://172.16.99.110:8080/iso/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://172.16.99.110:8080/iso/centos/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 172.16.99.110:8080/iso
failovermethod=priority
baseurl=http://172.16.99.110:8080/iso/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://172.16.99.110:8080/iso/centos/RPM-GPG-KEY-CentOS-7
评论区