我有一堆通过HAProxy传递给Resin集群的域。 这个想法是,当我收到一个404,因为一个不存在的子域,我想redirect到现有的页面,如下所示:
test123是一个不存在的子域,所以如果我提出请求http://test123.mydomain.com/rents-house-near-the-lake.html我想redirect到http://www.mydomain.com /rents-house-near-the-lake.html
(www是一个现有的子域名)
这将是可能的? 谢谢!!
创build一个ACL来匹配www子域名: acl is_host_www hdr(Host) -i www.mydomain.com
如果acl不匹配,则返回3XXredirect: redirect pfx http://www.mydomain.com unless is_host_www