首页 > 解决方案 > 子域重定向到 haproxy 中的同一后端

问题描述

如何将所有子域的主机路径重定向配置到同一支持服务器。

例如

my domain is example.com 
sub domains are *.example.com
I need to redirect *.example.com/abc/ to  another backed server.

我的前端 ACL 是

acl host_star hdr(host) -i *.example.com
use_backend back_live if host_star

acl is_node path_beg -i /abc/
use_backend backend_node if host_star is_node

我需要去 abc.example.com/abc/ 和 xyz.example.com/abc/ 到同一个后端服务器

标签: linuxload-balancingaclhaproxy

解决方案


我使用 hdr_end(host) 完成了它

acl host_star hdr_end(host) -i .example.com


推荐阅读