On Wed, Nov 19, 2014 at 8:37 AM, Qingshan Xie <xieq...@yahoo.com> wrote:
> I configured my HAProxy to use 'reqirep' to replace the Host header from
> site A.site.com to B.site.com as below,
>
> backend SFARM-PROXY
> reqirep ^Host: Host:\ B.site.com
>          server Proxy B.site.com:80
>
> When I tested it by accessing A.site.com/xyz, HAProxy redirected it to
> B.site.com/xyz in the first time.  its log shows 302.  but on the same
> browser, I typed A.site.com/xyz, HAProxy did not redirect it and log showed
> 200.  It's reproducible.  Can someone explain it?
>
> Thanks, Q.Xie

Hi Qingshan,

HAProxy does not generates any 200, your server did.
Also, from the configuration you pasted, I can say that HAProxy has
not generated this 302 as well.

And I thing you're misunderstanding "redirection" and "rewriting".
- redirection means HAProxy will generate a 302 to the client, telling
him to come back to B.site.com when it is browsing on A.site.com
- rewritting means HAProxy will update HTTP headers on the fly when
the traffic is passing through it.

Can you confirm which of the above you want to achieve exactly?

Also, can you paste your whole configuration and tell us which version
of HAProxy you are using.

Baptiste

Reply via email to