国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > Nginx > 正文

nginx反向代理進(jìn)行yum配置的步驟詳解

2024-08-30 12:24:35
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

part.0 使用背景

公司內(nèi)網(wǎng)服務(wù)器不能直接通過(guò)Internet上網(wǎng),但為了與外網(wǎng)通信和同步時(shí)間等,會(huì)指定那么幾臺(tái)服務(wù)器可以訪問(wèn)Internet。這里就是通過(guò)能上網(wǎng)的機(jī)器作為代理,制作內(nèi)網(wǎng)使用的yum倉(cāng)庫(kù)。

part.1 環(huán)境

內(nèi)網(wǎng)dns(推薦,非必須,因?yàn)榭墒褂肐P代替)

一臺(tái)能上Internet的服務(wù)器A

不能上Internet的服務(wù)器能與A服務(wù)器通信

part.2 nginx安裝

在可連接外網(wǎng)的A中安裝nginx

yum install nginx

part.3 nginx配置

在主機(jī)A中添加nginx配置

$ cd /etc/nginx/conf.d$ vim proxy.conf
server {  listen 80;  #listen [::]:80;  server_name mirrors.yourdomain.com;  index index.html index.htm index.php default.html default.htm default.php;  root /home/wwwroot/html;  location /ubuntu/ {   proxy_pass http://mirrors.aliyun.com/ubuntu/ ;  }  location /centos/ {   proxy_pass http://mirrors.aliyun.com/centos/ ;  }  location /epel/ {   proxy_pass http://mirrors.aliyun.com/epel/ ;  } }

part.4 配置yum repo 源

修改無(wú)法連接外網(wǎng)的主機(jī)B 的repo文件。

$ cat /etc/yum.repos.d/CentOS-7.repo
[base]name=CentOS-$releasever - Base - mirrors.yourdomain.comfailovermethod=prioritybaseurl=http://mirrors.yourdomain.com/centos/$releasever/os/$basearch/  http://mirrors.yourdomain.com/centos/$releasever/os/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirrors.yourdomain.com/centos/RPM-GPG-KEY-CentOS-7#released updates [updates]name=CentOS-$releasever - Updates - mirrors.yourdomain.comfailovermethod=prioritybaseurl=http://mirrors.yourdomain.com/centos/$releasever/updates/$basearch/  http://mirrors.yourdomain.com/centos/$releasever/updates/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirrors.yourdomain.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful[extras]name=CentOS-$releasever - Extras - mirrors.yourdomain.comfailovermethod=prioritybaseurl=http://mirrors.yourdomain.com/centos/$releasever/extras/$basearch/  http://mirrors.yourdomain.com/centos/$releasever/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirrors.yourdomain.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plus - mirrors.yourdomain.comfailovermethod=prioritybaseurl=http://mirrors.yourdomain.com/centos/$releasever/centosplus/$basearch/  http://mirrors.yourdomain.com/centos/$releasever/centosplus/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirrors.yourdomain.com/centos/RPM-GPG-KEY-CentOS-7#contrib - packages by Centos Users[contrib]name=CentOS-$releasever - Contrib - mirrors.yourdomain.comfailovermethod=prioritybaseurl=http://mirrors.yourdomain.com/centos/$releasever/contrib/$basearch/  http://mirrors.yourdomain.com/centos/$releasever/contrib/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirrors.yourdomain.com/centos/RPM-GPG-KEY-CentOS-7            
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 马关县| 新乡市| 宁蒗| 温泉县| 嘉定区| 土默特右旗| 花莲市| 寿光市| 柘荣县| 兴城市| 囊谦县| 甘肃省| 大竹县| 逊克县| 保康县| 蒲城县| 阿坝| 丰原市| 侯马市| 蒲城县| 长寿区| 惠来县| 枝江市| 广德县| 涞水县| 皋兰县| 邳州市| 黄大仙区| 射洪县| 介休市| 潮安县| 清苑县| 大同县| 安陆市| 安化县| 布尔津县| 藁城市| 礼泉县| 郓城县| 安庆市| 博野县|