<div dir="ltr">Good morning,<div><br></div><div>I am looking to run Squid as a forward proxy with basic auth in Docker on AWS ECS behind a network load balancer. I seem to have things up and running for the most part; however, I am having difficulty in getting proxy protocol to work so that I get access to client IP addresses beyond that of the private IPs of my NLB. As soon as I enable proxy protocol v2 on the AWS NLB, requests to Squid start failing with errors similar to the following:</div><div><br></div><div>Squid log: `1634330668.200      5 <nlb-private-ip> NONE_NONE/400 2032 - error:invalid-request - HIER_NONE/- text/html`</div><div>Client log: `X-Squid-Error: ERR_PROTOCOL_UNKNOWN 0`</div><div><br></div><div>--- Environment and Configuration details ---</div><div><br></div><div>Operating System: Alpine Linux 3.14.2</div><div><br></div><div>```</div><div>$ squid -v<br>Squid Cache: Version 5.0.6<br>Service Name: squid<br><br>This binary uses OpenSSL 1.1.1l  24 Aug 2021. For legal restrictions on distribution see <a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a><br><br>configure options:  '--build=x86_64-alpine-linux-musl' '--host=x86_64-alpine-linux-musl' '--prefix=/usr' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--libexecdir=/usr/lib/squid' '--localstatedir=/var' '--with-logdir=/var/log/squid' '--disable-strict-error-checking' '--disable-arch-native' '--enable-removal-policies=lru,heap' '--enable-auth-digest' '--enable-auth-basic=getpwnam,NCSA,SMB,SMB_LM,RADIUS' '--enable-epoll' '--enable-external-acl-helpers=file_userip,unix_group,wbinfo_group' '--enable-auth-ntlm=fake,SMB_LM' '--enable-auth-negotiate=kerberos,wrapper' '--disable-mit' '--enable-heimdal' '--enable-delay-pools' '--enable-openssl' '--enable-ssl-crtd' '--enable-linux-netfilter' '--enable-ident-lookups' '--enable-useragent-log' '--enable-cache-digests' '--enable-referer-log' '--enable-async-io' '--enable-truncate' '--enable-arp-acl' '--enable-htcp' '--enable-carp' '--enable-poll' '--enable-follow-x-forwarded-for' '--with-large-files' '--with-default-user=squid' '--with-openssl' 'build_alias=x86_64-alpine-linux-musl' 'host_alias=x86_64-alpine-linux-musl' 'CC=gcc' 'CFLAGS=-Os -fomit-frame-pointer' 'CPPFLAGS=-Os -fomit-frame-pointer' 'CXX=g++' 'CXXFLAGS=-Os -fomit-frame-pointer'</div><div>```</div><div><br></div><div>```</div><div>$ cat /etc/squid/squid.conf<br>auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd<br>auth_param basic realm proxy<br><br>acl authenticated proxy_auth REQUIRED<br>acl SSL_ports port 443<br>acl Safe_ports port 80<br><br>http_access allow authenticated<br>http_port 3128<br><br>cache deny all<br><br>pid_file</div><div>name /var/run/squid/squid.pid<br><br>visible_hostname <dns-for-nlb><br><br>debug_options ALL,1<br><br>acl hasRequest has request<br>access_log stdio:/proc/self/fd/1 hasRequest<br></div><div>```</div><div><br></div><div>I've looked into `proxy_protocol_access` and `http_port require-proxy-header`, but those both appear to be options to provide access control to Squid around proxy information. I'm simply looking to keep the basic auth in place as the access control mechanism while getting at the forwarded client information for logging purposes.</div><div><br></div><div>Is there something silly that I'm missing to get proxy protocol working with Squid and AWS NLBs?</div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br></div></div><div class="gmail_signature" data-smartmail="gmail_signature">Thanks,</div><div class="gmail_signature" data-smartmail="gmail_signature"><br></div><div class="gmail_signature" data-smartmail="gmail_signature">Ty</div></div>