On Wed, Jan 11, 2017 at 12:05:43AM +0200, Ciprian Dorin Craciun wrote: > On Tue, Jan 10, 2017 at 11:00 PM, Bryan Talbot > <[email protected]> wrote: > > Whatever the reason for forcing the connection closed -- it only closes > > when the scheme changes. Redirecting to a different host or port when using > > a ???scheme less??? URI allows the connection to be kept open. > > > > > > listen http > > bind :8000 > > http-request redirect location //127.0.0.2:8001/redir > > > > > [...] > > > > > > Maybe that will be useful to Ciprian to make the redirect to a new hostname > > but keep the connection to the old host open if that???s what is needed. > > > > Thanks for the suggestion, however there are two issues with this proposal: > > > (A) I'm not sure how would browsers in general behave when faced with > a schema-less URL in the `Location` header. > > A quick survey of the internet (i.e. the top search on Google points > to a StackOverflow question) suggests that browsers would handle these > "protocol-relative" URL's just fine when loading assets; however the > HTTP standard seems to mandate "absolute" URL's with regard of the > `Location` header: > > https://tools.ietf.org/html/rfc2616#section-14.30
This one is obsolete, the format of the Location header field is described here : https://tools.ietf.org/html/rfc7231#page-68 and it uses this format : https://tools.ietf.org/html/rfc3986#section-4.2 As you can see, "//" authority path, path-absolute etc... are permitted. However while I understand it could solve your issue, I think it's an ugly trick in that you use it only to work around an undesirable haproxy behaviour. We'd rather ensure haproxy doesn't behave this way if not needed. Of course it could be a short-term workaround saving your from modifying the code. Willy

