第一步:
F5上配置irules比對規則(在Definition中填寫 ),内容如下:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/exinterface111/*"
{
pool pool_name1
}
"/order/interface/export*"
pool pool_name2
"/order/interface/update*"
pool pool_name3
第二步:
然後在pool_name1後端對應的伺服器的nginx配置檔案中添加如下配置
proxy_set_header Host $host;
proxy_set_header X-Real-IP $http_x_forwarded_for;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
}
經過以上兩步,配置完成,則調用關系為:
備注:
1,後端現在是nginx的反向代理,換成haproxy原理一樣。
本文轉自Tenderrain 51CTO部落格,原文連結:http://blog.51cto.com/tenderrain/1611368,如需轉載請自行聯系原作者