一.nginx反向代理
1.在本地hosts文件当中修改要访问的nginx所在的主机ip和域名相对应
2.修改nginx的配置文件,设置监听和proxy_pass,重启nginx


二.nginx负载均衡

三.动静分离

四.总结
#反向代理小结:
location /a{
proxy_pass http://ip;
}
location /b/{
proxy_pass http://ip/;
}
####在浏览器当中输入以下会导致
/a/x ---> http://ip/a/x;
/b/x/ ---> http://ip/x;
网友评论