vlambda博客
学习文章列表

【代理是什么?】nginx快速入门+反向代理hexo个人博客

## 

---

- **nginx**

NginxWeb /反向代理服务器及电子邮件(IMAP/POP3点是


- **nginx用?

http理,

##  ''


****


**便** 


|  |  |

| - | - |


****


****的人



## 

---

### 

- --->--->访--->访

- <--<---访<--访

****


'LOL''vpn'访

### 


- -->访-->--->访

- <--访<--<---访

****


【代理是什么?】nginx快速入门+反向代理hexo个人博客

## 

---

|  | Vcpu | 梅莫|  |

| ---- | -- | --- | |

| 7 | 2 | 4 | NAT模式 |


**hexo**

https//blog..net/qq_48450494/article/details/ 124200611



## 

### 

#### epel

[root@localhost ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo  #epelnginx--2022-04-18 21:54:35--  http://mirrors.aliyun.com/repo/epel-7.repoResolving mirrors.aliyun.com (mirrors.aliyun.com)... 113.207.38.89, 113.207.38.90, 113.207.38.85, ...Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|113.207.38.89|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 664 [application/octet-stream]Saving to: /etc/yum.repos.d/epel.repo

100%[======================================================================================>] 664 --.-K/s in 0s

2022-04-18 21:54:36 (131 MB/s) - /etc/yum.repos.d/epel.repo saved [664/664]

#### yumnginx

[root@localhost ~]# yum install -y nginx  #yumnginxLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comResolving Dependencies--> Running transaction check---> Package nginx.x86_64 1:1.20.1-9.el7 will be installed--> Processing Dependency: nginx-filesystem = 1:1.20.1-9.el7 for package: 1:nginx-1.20.1-9.el7.x86_64--> Processing Dependency: libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) for package: 1:nginx-1.20.1-9.el7.x86_64--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_0)(64bit) for package: 1:nginx-1.20.1-9.el7.x86_64--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_1)(64bit) for package: 1:nginx-1.20.1-9.el7.x86_64--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.20.1-9.el7.x86_64--> Processing Dependency: redhat-indexhtml for package: 1:nginx-1.20.1-9.el7.x86_64--> Processing Dependency: libcrypto.so.1.1()(64bit) for package: 1:nginx-1.20.1-9.el7.x86_64--> Processing Dependency: libprofiler.so.0()(64bit) for package: 1:nginx-1.20.1-9.el7.x86_64--> Processing Dependency: libssl.so.1.1()(64bit) for package: 1:nginx-1.20.1-9.el7.x86_64

#### nginx

[root@localhost ~]# systemctl stop firewalld && systemctl disabel firewalld  #[root@localhost ~]# setenforce 0  #selinux[root@localhost ~]# systemctl start nginx #nginx[root@localhost ~]# systemctl enable nginx #nginx

访nginx图所示:

【代理是什么?】nginx快速入门+反向代理hexo个人博客

#### . conf文件

[root@localhost ~]# cat /etc/nginx/conf.d/default.conf  # 如果没有conf.d目录需要创建,默认我们这里下载的nginx版本没有default.conf,创建即可server { listen 80;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main; location / { # root html; # index index.html index.htm; proxy_pass http://127.0.0.1:4000; #http根/目录,代理到http://127.0.0.1:4000 }}
[root@localhost ~]# systemctl restart nginx

****

`ip``4000`访

`over`




## 

[root@localhost ~]# yum remove -y nginx  #yumnginxLoaded plugins: fastestmirrorResolving Dependencies--> Running transaction check---> Package nginx.x86_64 1:1.20.1-9.el7 will be erased--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================ Package Arch Version Repository Size================================================================================================================================Removing: nginx x86_64 1:1.20.1-9.el7 @epel 1.7 M

Transaction Summary================================================================================================================================Remove 1 Package

Installed size: 1.7 MDownloading packages:Running transaction checkRunning transaction testTransaction test succeededRunning transaction Erasing : 1:nginx-1.20.1-9.el7.x86_64 1/1warning: /etc/nginx/nginx.conf saved as /etc/nginx/nginx.conf.rpmsave Verifying : 1:nginx-1.20.1-9.el7.x86_64 1/1

Removed: nginx.x86_64 1:1.20.1-9.el7

Complete!

[root@localhost ~]# rm -rf /etc/nginx* #




## 

### 

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo yum install -y nginx [root@localhost ~]# systemctl stop firewalld && systemctl disabel firewalld浏览器 验证[root@localhost ~]# setenforce 0[root@localhost ~]# systemctl start nginx[root@localhost ~]# systemctl enable nginx[root@localhost ~]# cat /etc/nginx/conf.d/default.confserver { listen 80; server_name localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / { # root html; # index index.html index.htm; proxy_pass http://127.0.0.1:4000;  }}[root@localhost ~]# systemctl restart nginx浏览器 验证

### 

[root@localhost ~]*# yum remove -y nginx*[root@localhost ~]*# rm -rf /etc/nginx**