本文共 798 字,大约阅读时间需要 2 分钟。
#Demo1负载均衡池upstream bolg_pool{ server 127.0.0.1:8081;}#Demo2负载均衡池upstream img_pool{ server 127.0.0.1:8022;}
server { listen 80; #拦截端口 server_name bolg.xxxxx.com; #域名配置 access_log logs/bolg.log; error_log logs/bolg.error; #将所有请求转发给blog_pool池的应用处理 location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://blog_pool; #如果是ssl更改成https }}
server { listen 80; #拦截端口 server_name img.xxxxx.com; #域名配置 access_log logs/img.log; error_log logs/img.error; #将所有请求转发给img_pool池的应用处理 location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://img_pool;#如果是ssl更改成https }}
转载地址:http://tswza.baihongyu.com/