# Front End Authentication

**URL:** <https://discourse.haproxy.org/t/front-end-authentication/1760>\
**Category:** Help!\
**Created:** [November 11, 2017, 6:04am UTC](https://discourse.haproxy.org/t/front-end-authentication/1760 "2017-11-11T06:04:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![networknewb](https://avatars.discourse-cdn.com/v4/letter/n/a587f6/32.png) [@networknewb](https://discourse.haproxy.org/u/networknewb)\
**Post date:** [November 11, 2017, 6:04am UTC](https://discourse.haproxy.org/t/front-end-authentication/1760/1 "2017-11-11T06:04:59Z")

</div>

Hi Everyone,

New to HAProxy and trying to figure out how to get authentication to work on the front end. using haproxy 1.7.8

What i am aiming to do is the following:

Client -\> HAProxy(as a proxy tunnel) -\> server/1/2/3/4/5

I am running squid on the back end, everything is working but then i wanted to add authentication to HAProxy as i have white listed my HAProxy VM in the squid configuration which allows access to all connections. Note the ‘#’ are there as that is the configuration that works, when i remove them i get a ‘ERR\_TUNNEL\_CONNECTION\_FAILED’ error.

Always the squid server is also local on another VM where i am using my /64 ipv6 from my ISP. Just trying to learn all these things.

Configuration:

global  
log /dev/log local0  
log /dev/log local1 notice  
chroot /var/lib/haproxy  
stats timeout 30s  
user haproxy  
group haproxy  
daemon  
#userlist Admins  
#group AdminGroup users admin  
#user admin insecure-password 1234

defaults  
log global  
mode http  
option httplog  
option dontlognull  
timeout connect 5000  
timeout client 50000  
timeout server 50000

frontend http\_front  
#acl AuthOkay\_UsersAuth http\_auth(Admins)  
#http-request auth realm Admins unless AuthOkay\_UsersAuth  
bind \*:8000  
stats uri /haproxy?stats  
default\_backend http\_back

backend http\_back  
option http-tunnel  
server squid0 x.x.x.x:20100 check  
server squid1 x.x.x.x:20101 check  
server squid2 x.x.x.x:20102 check  
server squid3 x.x.x.x:20103 check  
server squid4 x.x.x.x:20104 check  
balance roundrobin

listen stats  
bind \*:8181  
stats enable  
stats uri /  
stats realm Haproxy\ Statistics  
stats auth test:test

Any tips would be great, Thanks!

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [November 12, 2017, 12:54pm UTC](https://discourse.haproxy.org/t/front-end-authentication/1760/2 "2017-11-12T12:54:41Z")

</div>

Authentication works for HTTP only. Exactly what is the protocol you are using here? Share client and squid configuration please.
