You need to prepare haproxy for some non-standard requests too. Take a look at this weird GET
:
$ echo -ne "GET http://google.com/books/ HTTP/1.1\r\nHost: google.com\r\n\r\n" | nc -v google.com 80
Connection to google.com 80 port [tcp/http] succeeded!
HTTP/1.1 301 Moved Permanently
Location: http://books.google.com/books/
...
For comparison, the standard way:
$ echo -ne "GET /books/ HTTP/1.1\r\nHost: google.com\r\n\r\n" | nc -v google.com 80
Connection to google.com 80 port [tcp/http] succeeded!
HTTP/1.1 301 Moved Permanently
Location: http://books.google.com/books/
...
And how to produce the same weird GET with curl
:
$ curl -v --request-target http://google.com/books/ http://google.com/books/
* Trying 172.217.16.14...
* TCP_NODELAY set
* Connected to google.com (172.217.16.14) port 80 (#0)
> GET http://google.com/books/ HTTP/1.1
> Host: google.com
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Location: http://books.google.com/books/