需求如下:

1:域名 club.jesse.com PC端访问正常显示

2:手机端:Android iPhone 访问首页跳转到3g.club.jesse.com,

3:static big_* small_* 这几类文件开头的 进行跳转 进行跳转 效果如下所示:

访问:http://club.jesse.com/static/20130916/27635260.htm

跳转到:http://3g.club.jesse.com/static/20130916/27635260.htm

 

4:手机端访问:除规则3以外的不跳转:如http://club.xywy.com/top.htm 

访问URL 不变。

 

Haproxy主要配置如下:

acl static_d path_beg /static /small /big  #匹配XX开始的
acl index_page path_reg ^/$  #匹配首页
acl ua hdr_reg(User-Agent) -i iphone android #匹配User-Agent类型
acl club hdr_reg(host) -i   club.jesse.com #匹配访问的域名
redirect prefix http://3g.club.jesse.com if ua static_d club #匹配相关的ACL策略就进行跳转
redirect prefix http://3g.club.jesse.com if index_page ua club
use_backend club_pool if club

相关文章:

  • 2022-02-10
  • 2022-01-02
  • 2021-10-09
  • 2022-12-23
  • 2021-05-25
  • 2021-08-08
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2022-12-23
  • 2022-01-21
  • 2021-12-19
  • 2022-12-23
  • 2022-01-15
  • 2022-02-08
相关资源
相似解决方案