nginx在网站中的7层转发功能(2)
^ ^ ^ | | |
| | | | | |
+----------- |--------------- |----------+ | |
+---------------|---------------------+ |
+-------------------------------+
LB-Nginx:
Client:
CIP: 202.106.0.56
Director-Nginx:
VIP: 202.106.0.254
DIP: 192.168.0.1
Director配置:
1、安装nginx
cd /etc/nginx/conf.d
vim rip.conf
upstream squids {
server 192.168.0.254:3128;
server 192.168.0.208:3128;
server 192.168.0.39:3128;
RealServer
}
upstream apaches {
server 192.168.0.14:80;
server 192.168.0.231:80;
server 192.168.0.49:80;
}
upstream tomcats {
server 192.168.0.119:8080;
server 192.168.0.188:8080;
server 192.168.0.194:8080;
}
2、vim /etc/nginx/nginx.conf
location / {
root /usr/share/nginx/html;
index index.html index.htm;
if ($request_uri ~* ".*\.html$")
{
proxy_pass http://squids;
}
相关新闻>>
- 发表评论
-
- 最新评论 更多>>