侧边栏壁纸
博主头像
不负韶华,以梦为马 博主等级

行动起来,活在当下

  • 累计撰写 16 篇文章
  • 累计创建 3 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

通过nginx代理镜像源方式

better2smile
2024-12-14 / 0 评论 / 0 点赞 / 32 阅读 / 0 字 / 正在检测是否收录...

通过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-7-ng.repo

epel-7-ng.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

0

评论区