负载均衡与缓存
反向代理 ¶ 反向代理服务器配置nginx.conf #配置域名为test.web1.test的虚拟主机 server{ listen 80; server_name test.web1.test; #域名test.web1.test的请求全部转发到Web服务器192.168.1.101 location / { proxy_pass http://192.168.1.101 ; } } #配置域名为test.web2.test的虚拟主机 server{ listen 80; server_name test.web2.test; #域名test.we2.test的请求全部转发到Web服务器192.168.1.102 location / { proxy_pass http://192.168.1.102 ; } } 实验客户端配置,hosts文件,...103为nginx反向代理服务器地址 192.168.1.103 test.web1.test 192.168.1.103 test.web2.test 反向代理其他指令 proxy_set_header 在将客户端请求发送给后端服务器之前,更改来自客户端的请求头信息 proxy_connect_timeout 配置与后端服务器尝试建立连接的超时时间 proxy_read_ timeout 配置向后端服务器组发出read请求后