We have an application that need to be accessible from two DNS and for which requests' URLs should be rewritten.
We configured marathon-lb as follow:
HAPROXY_0_VHOST=dns1.com,dns2.comHAPROXY_0_PATH=/apiHAPROXY_0_HTTP_BACKEND_PROXYPASS_PATH=/api
We see requests arriving to the application with a Host header equal to dns1.com,dns2.com (which breaks some stuff in our own code). Skimming through the code, I think the issue lies in the default HTTP_BACKEND_PROXYPASS template which is:
This takes the app hostname (the content of HAPROXY_0_VHOST) and put it directly in the Host header, regardless of the original value.
I can override this default template, but I wonder why it has been written this way. What is the point of rewriting the Host header to the value it should already have? Am I missing something?
Please note it works well when HAPROXY_0_VHOST contains a single entry.
Hi,
We have an application that need to be accessible from two DNS and for which requests' URLs should be rewritten.
We configured marathon-lb as follow:
HAPROXY_0_VHOST=dns1.com,dns2.com
HAPROXY_0_PATH=/api
HAPROXY_0_HTTP_BACKEND_PROXYPASS_PATH=/api
We see requests arriving to the application with a
Host
header equal todns1.com,dns2.com
(which breaks some stuff in our own code). Skimming through the code, I think the issue lies in the defaultHTTP_BACKEND_PROXYPASS
template which is:This takes the app hostname (the content of
HAPROXY_0_VHOST
) and put it directly in the Host header, regardless of the original value.I can override this default template, but I wonder why it has been written this way. What is the point of rewriting the Host header to the value it should already have? Am I missing something?
Please note it works well when
HAPROXY_0_VHOST
contains a single entry.Thanks :)