安装:
1 | yum install nginx -y |
启动:
1 | systemctl start nginx |
反向代理的实现:
1. 找到nginx的配置文件,并修改
1 | vi /etc/nginx/nginx.conf |
2.找到nginx配置文件http块中的server块,在location块中将当前服务器代理到其他可访问服务器上,即访问当前localhost跳转至XXXX.top页面
1 | location /{ |
3.重启nginx服务:
1 | systemctl restart nginx |
效果展示:

反向代理对象如果有下一级目录,也同样可以访问到
