Nginx 配置反向代理及负载均衡的实现
一、nginx的反向代理及多台虚拟机负载均衡的实现
主机负载均衡服务器:192.168.232.132 的nginx.conf 配置如下
http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; #gzip on; upstream myproxy { ip_hash; server 192.168.232.129:8888; server 192.168.232.128:8081; } server { listen 80; server_name localhost; location / { proxy_pass http://myproxy; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
二、两台web服务器如下:
server 192.168.232.129:8888; server 192.168.232.128:8081;
佛语:我本求心不求佛,了知三界空无物,若欲求佛但求心,只这心心心是佛