Hi Jakov, On Fri, Nov 19, 2010 at 01:06:39PM +0100, Jakov Sosic wrote: > Hi. > > > I have a haproxy doing load balacing between two apache servers which > have mod_jk. Application is on JBoss application server. Problem that I > have noticed is that if link has some UTF-8 character (Croatian language > characters), then haproxy gives error 502. Here is example from log: > > > Nov 19 12:40:24 porat haproxy[28047]: aaa.bbb.ccc.ddd:port > [19/Nov/2010:12:40:24.040] www www/backend-srv1 0/0/0/-1/135 502 1833 - > - PHVN 1/1/1/0/0 0/0 "GET > /pithos/rest/usern...@domain/files/folder%C4%8Di%C4%87/ HTTP/1.1" > > Nov 19 12:40:34 porat haproxy[28047]: aaa.bbb.ccc.ddd:port > [19/Nov/2010:12:40:34.710] www www/backend-srv1 0/0/0/-1/82 502 1061 - - > PHVN 5/5/5/4/0 0/0 "GET > /pithos/rest/usern...@domain/files/%C4%8D%C4%87%C5%A1%C4%91%C5%BE/ > HTTP/1.1" > > Problem only occurs for links with those specific characters. > > Interesting thing is that haproxy is the reason for that errors, because > when I try to get those same links directly from backend servers, links > work without problem...
The issue is with the response, not the request (flags "PH"). If you have enabled you stats socket, you can get the exact location of the error that way : # echo "show errors" | socat stdio unix-connect:/var/run/haproxy.sock (or whatever the path to the socket). This will be useful because it indicates that one character in the response was not valid from an HTTP point of view. Normally if the error is not too serious, you can force haproxy to let it pass with this option in your backend : option accept-invalid-http-response However, you should only do that once you've figured what the error is and you need time to fix it, because unless there is a bug in haproxy, it generally indicates a wrong header name in the response from the server. Regards, Willy