简体   繁体   English

Tutum HAProxy Docker虚拟主机转发到入口点路径

[英]Tutum HAProxy Docker Virtual Host forward to entry point path

I'm trying to use the HAProxy tutum docker image to load balance between two different web applications. 我正在尝试使用HAProxy tutum docker映像在两个不同的Web应用程序之间进行负载平衡。 Both web applications has an entry point of "/". 两个Web应用程序的入口点均为“ /”。 At section Virtual host and virtual path I see that I can use virtual hosts to route to the different services. 在“ 虚拟主机和虚拟路径”部分,我看到可以使用虚拟主机路由到不同的服务。 I've tried to set the VIRTUAL_HOST parameter for web app 1 to */webapp1* and for web app 2 I've set it to /*webapp2* . 我尝试将Web应用程序1的VIRTUAL_HOST参数设置为*/webapp1* ,对于Web应用程序2,将其设置为/*webapp2* But when try to navigate to web app 1 through HAProxy (using for example http://haproxy-test.myname.svc.tutum.io/webapp1 ) it forwards me to http://<internal_ip_to_webapp1/webapp1 . 但是,当尝试通过HAProxy导航到Web应用程序1时(例如使用http://haproxy-test.myname.svc.tutum.io/webapp1 ),它将把我转发到http://<internal_ip_to_webapp1/webapp1 I would like HAProxy to forward calls to /webapp1 to http://<internal_ip_to_webapp1> (ie the entry point of web app 1). 我希望HAProxy将对/webapp1调用/webapp1http://<internal_ip_to_webapp1> (即Web应用程序1的入口点)。 How can I achieve this? 我该如何实现?

You should try adding the host name in the VIRTUAL_HOST parameter. 您应该尝试在VIRTUAL_HOST参数中添加主机名。

like http://haproxy-test.myname.svc.tutum.io/webapp1/* http://haproxy-test.myname.svc.tutum.io/webapp1/*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM