zoukankan      html  css  js  c++  java
  • Haproxy 配置 ACL 处理不同的 URL 请求

    1. 需求说明
      服务器介绍:
      HAProxy Server: 192.168.1.90
      WEB1 : 192.168.1.103
      WEB2 : 192.168.1.105
      Domain: tecadmin.net
      当用户访问:tecadmin.net/blog链接,只会跳转到WEB2(192.168.1.105)服务器.
      而其他所有的访问将根据权值跳转到WEB1或者WEB2服务器
    2. 配置文件
      global
          log 127.0.0.1 local0 notice
          maxconn 50000
          daemon
      defaults
          log global
          mode http
          option httplog
          option dontlognull
          contimeout 120000
          clitimeout 120000
          srvtimeout 120000
          option forwardfor
          option http-server-close
      
      # Configuration for HTTP site
      frontend http-in
          bind 192.168.1.90:80
          acl is_blog url_beg  /blog
          use_backend tecadmin_blog if is_blog
          default_backend tecadmin_website
      
      backend tecadmin_blog
          mode http
          balance roundrobin  # Load Balancing algorithm
          option httpchk
          option forwardfor
          server WEB2 192.168.1.105:80 weight 1 maxconn 512 check
      
      backend tecadmin_website
          mode http
          balance roundrobin  # Load Balancing algorithm
          option httpchk
          option forwardfor
          server WEB1 192.168.1.103:80 weight 1 maxconn 512 check
          server WEB2 192.168.1.105:80 weight 1 maxconn 512 check
      haproxy Code
    3. 参考链接:http://tecadmin.net/haproxy-acl-for-load-balancing-on-url-request/
  • 相关阅读:
    标准MIDI文件格式
    David's MIDI Spec
    国庆长假好读书
    vim用法
    ,非你莫属,
    子宫的满足,睡觉前,
    在哪里,
    黑条,
    下单 返回的字段,
    机会啊,游戏啊,转吧,
  • 原文地址:https://www.cnblogs.com/Mrhuangrui/p/4600983.html
Copyright © 2011-2022 走看看