我正在尝试在我的haproxy.cfg文件中redirect一个URL,不知道从哪里开始。 什么我的目标是什么时候我去https://网站/文本它被redirect到https://网站/#/文本/对话和语音同样的事情。 我到底该怎么做? 我正在使用HAProxy版本1.5.14。 下面是我(尝试),但它不工作,因为我想要的。
frontend HTTPS_IN acl host_connect hdr(host) -i website.com acl path_voice path_beg -i /voice redirect location https://website/#/voice/voicemail if path_voice acl path_text path_beg -i /text redirect location https://website/#/text/conversation if path_text use_backend voice if path_voice use backend voice if host_connect use_backend text if path_text
我在正确的道路上呢? 如果没有,你们可以帮我吗?
谢谢!
它看起来像你设置host_connect acl,如果它连接到website.com。 以后没有什么改变,所以它总是会匹配use backend voice if host_connect因此,我希望你总是最终在语音后端。
尝试这样做,而不是:
frontend HTTPS_IN acl path_voice path_beg -i /voice redirect location https://website/#/voice/voicemail if path_voice acl path_text path_beg -i /text redirect location https://website/#/text/conversation if path_text use_backend voice unless path_text