haproxy 跨域访问:

haproxy 跨域访问:


需求 开发人员 在hosts里加入 www.wwm3.com 对应地址192.168.32.173(代理地址)

就是通过访问www.wwm3.com 跳转到zjtest3.com


配置如下:
### for wwm3 ###
        acl             wwm3_1_req                hdr_beg(host)           -i                      www.wwm3.com
        acl             url_web_wwm3              path_beg                -i                      /web
        use_backend     appserver_8081          if                      wwm3_1_req                url_web_wwm3

        acl             wwm3_2_req                hdr_beg(host)           -i                      www.wwm3.com
        acl             url_business_wwm3         path_beg                -i                      /business
        use_backend     appserver_8081          if                      wwm3_2_req                url_business_wwm3

        acl             wwm3_3_req                hdr_beg(host)           -i                      www.wwm3.com
        acl             url_validcode_wwm3        path_beg                -i                      /validcode
        use_backend     appserver_8081          if                      wwm3_3_req                url_validcode_wwm3

        acl             wwm3_4_req                hdr_beg(host)           -i                      www.wwm3.com
        acl             url_api_wwm3             path_beg                -i                      /api
        use_backend     appserver_8082          if                      wwm3_4_req                url_api_wwm3

        acl             wwm3_5_req                hdr_beg(host)           -i                      www.wwm3.com
        acl             url_pay_wwm3              path_beg                -i                      /pay
        use_backend     appserver_8083          if                      wwm3_5_req                url_pay_wwm3

        acl             wwm3_6_req                hdr_beg(host)           -i                      www.wwm3.com
        acl             url_static_wwm3          path_end                .html .gif .png .jpg .css .js .eot .svg .ttf .woff .swf
        use_backend     webserver_8001              if                      wwm3_6_req                url_static_wwm3


你可能感兴趣的:(haproxy 跨域访问:)