Error 400 -> Error 502

2014-01-14 Thread Florian Engelmann

Hi,

we are using HAProxy 1.5-dev21 as loadbalancer frontend and some NGINX 
1.4 servers as backend. Everything is working perfect. Great piece of 
software!


One question:
If some client sends a request like:

GET something.someone

This request is forwarded to the backends even if it is not a valid 
request. The backend (NGINX) replies with an error page 400 (Bad 
Request). This is an invalid response to HAProxy which will deliver a 
502 (Bad Gateway) error to the client.


Response to client:
2014-01-14T15:17:04+01:00 somehostname haproxy[9]: 
xxx.1xx.2xx.xx:50294 [14/Jan/2014:15:17:04.648] application8089 
application8089/somehostname.some.domain 0/0/0/-1/1 502 370 - - PH-- 
475/441/8/0/0 0/0 \"GET usacording.com HTTP/1.0\"


HAProxy error:
[14/Jan/2014:16:52:07.357] backend application8089 (#11) : invalid response
  frontend application8089 (#11), server somehostname.some.domain (#2), 
event #2211

  src xxx.1xx.2xx.xx:55112, session #2141081, session flags 0x048e
  HTTP msg state 26, msg flags 0x, tx flags 0x0830
  HTTP chunk len 0 bytes, HTTP body len 0 bytes
  buffer flags 0x8023, out 0 bytes, total 166 bytes
  pending 166 bytes, wrapping at 16384, error at position 0:

  0  \r\n
  8  400 Bad Request\r\n
  00053  \r\n
  00077  400 Bad Request\r\n
  00120  nginx\r\n
  00148  \r\n
  00157  \r\n

Is it possible to respond the original error (400) to the client?

Regards,
Florian


--

EveryWare AG
Florian Engelmann
Systems Engineer
Zurlindenstrasse 52a
CH-8003 Zürich

tel: +41 44 466 60 00
fax: +41 44 466 60 10
mail: mailto:florian.engelm...@everyware.ch
web: http://www.everyware.ch



Re: Error 400 -> Error 502

2014-01-15 Thread Florian Engelmann

Hi,

"option accept-invalid-http-response"

was the solution.

Regards,
Florian

On 14.01.2014 17:31, Florian Engelmann wrote:

Hi,

we are using HAProxy 1.5-dev21 as loadbalancer frontend and some NGINX
1.4 servers as backend. Everything is working perfect. Great piece of
software!

One question:
If some client sends a request like:

GET something.someone

This request is forwarded to the backends even if it is not a valid
request. The backend (NGINX) replies with an error page 400 (Bad
Request). This is an invalid response to HAProxy which will deliver a
502 (Bad Gateway) error to the client.

Response to client:
2014-01-14T15:17:04+01:00 somehostname haproxy[9]:
xxx.1xx.2xx.xx:50294 [14/Jan/2014:15:17:04.648] application8089
application8089/somehostname.some.domain 0/0/0/-1/1 502 370 - - PH--
475/441/8/0/0 0/0 \"GET usacording.com HTTP/1.0\"

HAProxy error:
[14/Jan/2014:16:52:07.357] backend application8089 (#11) : invalid response
   frontend application8089 (#11), server somehostname.some.domain (#2),
event #2211
   src xxx.1xx.2xx.xx:55112, session #2141081, session flags 0x048e
   HTTP msg state 26, msg flags 0x, tx flags 0x0830
   HTTP chunk len 0 bytes, HTTP body len 0 bytes
   buffer flags 0x8023, out 0 bytes, total 166 bytes
   pending 166 bytes, wrapping at 16384, error at position 0:

   0  \r\n
   8  400 Bad Request\r\n
   00053  \r\n
   00077  400 Bad Request\r\n
   00120  nginx\r\n
   00148  \r\n
   00157  \r\n

Is it possible to respond the original error (400) to the client?

Regards,
Florian






Re: Error 400 -> Error 502

2014-01-15 Thread Baptiste
It should be considered as a temporary workaround until you fix your broken
application.

Baptiste
 Le 15 janv. 2014 11:20, "Florian Engelmann" 
a écrit :

> Hi,
>
> "option accept-invalid-http-response"
>
> was the solution.
>
> Regards,
> Florian
>
> On 14.01.2014 17:31, Florian Engelmann wrote:
>
>> Hi,
>>
>> we are using HAProxy 1.5-dev21 as loadbalancer frontend and some NGINX
>> 1.4 servers as backend. Everything is working perfect. Great piece of
>> software!
>>
>> One question:
>> If some client sends a request like:
>>
>> GET something.someone
>>
>> This request is forwarded to the backends even if it is not a valid
>> request. The backend (NGINX) replies with an error page 400 (Bad
>> Request). This is an invalid response to HAProxy which will deliver a
>> 502 (Bad Gateway) error to the client.
>>
>> Response to client:
>> 2014-01-14T15:17:04+01:00 somehostname haproxy[9]:
>> xxx.1xx.2xx.xx:50294 [14/Jan/2014:15:17:04.648] application8089
>> application8089/somehostname.some.domain 0/0/0/-1/1 502 370 - - PH--
>> 475/441/8/0/0 0/0 \"GET usacording.com HTTP/1.0\"
>>
>> HAProxy error:
>> [14/Jan/2014:16:52:07.357] backend application8089 (#11) : invalid
>> response
>>frontend application8089 (#11), server somehostname.some.domain (#2),
>> event #2211
>>src xxx.1xx.2xx.xx:55112, session #2141081, session flags 0x048e
>>HTTP msg state 26, msg flags 0x, tx flags 0x0830
>>HTTP chunk len 0 bytes, HTTP body len 0 bytes
>>buffer flags 0x8023, out 0 bytes, total 166 bytes
>>pending 166 bytes, wrapping at 16384, error at position 0:
>>
>>0  \r\n
>>8  400 Bad Request\r\n
>>00053  \r\n
>>00077  400 Bad Request\r\n
>>00120  nginx\r\n
>>00148  \r\n
>>00157  \r\n
>>
>> Is it possible to respond the original error (400) to the client?
>>
>> Regards,
>> Florian
>>
>>
>>
>