nginx反向代理和负载均衡《实战》

一、nginx反向代理

反向代理服务器:192.168.4.51

HTTP1192.168.4.52

HTTP2192.168.4.53

 

 

安装方法参考上篇 关键字【nginx安装】

 

Nginx主机

vim /usr/local/nginx/conf/nginx.conf server { listen 80; #监听端口 server_name ; #用来指定IP地址或者域名,多个域名之间用空格分开 #charset koi8-r; #access_log logs/host.access.log main; location / { #根目录 root html; #指定虚拟主机的网页根目录 proxy_pass http://192.168.4.52:80; #代理的主机和端口 index index.html index.htm; #默认首页地址 } server { listen 80; server_name ; # listen somename:8080; # server_name somename alias another.alias; location / { root html; proxy_pass http://192.168.4.53:80; index index.html index.htm; } }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpzfjj.html