#yyds干货盘点#nginx配置

丈夫志四海,万里犹比邻。这篇文章主要讲述#yyds干货盘点#nginx配置相关的知识,希望能为你提供帮助。
nginx正向代理和反向代理配置



1.部署nginx服务:

yum install epel-relase -y
yum install nginx -y
vim /etc/nginx/nginx.conf
root/usr/share/nginx/html;
location /
systemctl start nginx(启动nginx服务)
systemctl enable nginx(开机默认启动nginx服务)
systemctl stop firewall(关闭防火墙)
systemctl disable firewall(开机默认不启动防火墙)

2.部署三台web服务器,nginx服务:
在nginx主服务器上修改/etc/nginx/nginx.conf文件
http
upstream myapp1
server srv1.example.com;
server srv2.example.com;
server srv3.example.com;

server
listen 80;
location /
proxy_pass http://myapp1;



3.安装NFS服务,即网络文件系统
共享服务器上和web服务器上安装NFS
yum install rpcbind nfs-utils -y

1.共享服务器上安装硬盘
【#yyds干货盘点#nginx配置】2.硬盘分区
3.硬盘格式化
4.创建共享目录/share
5.挂载硬盘到/share下
6.修改配置
[root@MiWiFi-R3-srv nginx]# cat /etc/exports
/share 192.168.10.0/24(rw,sync,fsid=0)

7.开权限(nfs开启了w权限还不行,others还需要对/share目录有w权限)
chmod -R o+w /share


    推荐阅读