使用haproxy根据网站名称重定向SSL网站

时间:2019-05-03 22:42:45

标签: haproxy

嗨,我正在尝试使用haproxy进行URL上下文切换。文件/etc/haproxy/sites.txt包含一个网站列表,我希望将其重定向到其他服务器10.0.0.2(默认服务器除外)。对于使用以下代码段的http网站,没有任何问题,它工作正常。

let inner:[String:Any] = ["key":"value"]
let str:[String:Any] = ["currentKm": currentKm,
                       "addID":inner]

databaseRef.updateChildValues(str)

此处未卸载SSL。

现在,当它用于SSL站点时,我尝试使用https://website.com,那么它仅用于默认后端。我正在使用以下配置,但似乎出了点问题,无法按预期工作。

backend backend_http
     server server2 10.0.0.2:80

acl accesslist1 hdr(host) -f /etc/haproxy/sites.txt
use_backend backend_http if accesslist1 

在这件事上您能帮忙吗?谢谢

0 个答案:

没有答案
相关问题