I suspect they want to get at the X-Forwarded-For
original IP of the requestor for the logs. I know I am.
ELBs don't forward these headers when using TCP in the ELB, but if you set to HTTP/3128 then it does. But now squid doesn't work.
$ curl -v -x http://MYELB.us-east-1.elb.amazonaws.com:3128 -L http://httpbin.org/ip
* Hostname was NOT found in DNS cache
* Trying 10.0.153.134...
* Connected to MYELB.us-east-1.elb.amazonaws.com (10.0.153.134) port 3128 (#0)
> GET http://httpbin.org/ip HTTP/1.1
> User-Agent: curl/7.35.0
> Host: httpbin.org
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 400 Bad Request
< Content-Language: en
< Content-Type: text/html;charset=utf-8
< Date: Mon, 06 Jun 2016 17:25:17 GMT
< Mime-Version: 1.0
* Server squid/3.5.12 is not blacklisted
< Server: squid/3.5.12
< Vary: Accept-Language
< Via: 1.1 ip-10-0-139-174 (squid/3.5.12)
< X-Cache: MISS from ip-10-0-139-174
< X-Cache-Lookup: NONE from ip-10-0-139-174:3128
< X-Squid-Error: ERR_INVALID_URL 0
< Content-Length: 3540
< Connection: keep-alive
If you look at the TCPDUMP from the squid box you see this:
GET /ip HTTP/1.1
host: httpbin.org:3128
Accept: */*
Proxy-Connection: Keep-Alive
User-Agent: curl/7.35.0
X-Forwarded-For: 172.17.0.5
X-Forwarded-Port: 3128
X-Forwarded-Proto: http
Connection: keep-alive
Which squid barfs on because it isn't a real URL (the server got stripped out of the GET):
HTTP/1.1 400 Bad Request
Server: squid/3.5.12
Mime-Version: 1.0
Date: Mon, 06 Jun 2016 17:28:07 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 3540
X-Squid-Error: ERR_INVALID_URL 0
Vary: Accept-Language
Content-Language: en
X-Cache: MISS from ip-10-0-139-174
X-Cache-Lookup: NONE from ip-10-0-139-174:3128
Via: 1.1 ip-10-0-139-174 (squid/3.5.12)
Connection: close
Any ideas on how to get the ELB to pass the server name? Also not clear why the host header has port 3128 on it.