HAProxy community

Need configuration for redirekt to proxy with authentication

#1

Hello,

i want to create a http-proxy that redirect every http and https request to a set of to other http-proxys with round-robin.

My problem ist, that these two proxys require both basic authentication and that my proxy itself should also be protected with basic authentication.

So harproxys should only accept connection with the right basic authentication credentials, add some other http basic authentication to the request and redirect the request to one of the targe http proxys.

How can I archive this?

Thanks and regards.
Chris

0 Likes

#2

Basically you want to send a static set of credentials to the backend server via basic authentication, and additionally, authenticate the proxy clients locally on haproxy?

Do your existing backend proxies use 401 Unauthorized --> WWW-Authenticate or 407 Proxy Authentication Required --> Proxy-Authenticate ?

0 Likes

#3

The proxys are using Proxy Authroization. They will reply with 407 if no authentication header is set

0 Likes

#4

I can manipulate the header information for the backend proxys with

# Remove the old authentication header
reqdel Proxy-Authorization
# Add new authentication header
reqadd Proxy-Authorization:\ Basic\ xxxxxxx

But i am not able to add another authentication to frontend proxy (harproxy itself).

0 Likes

#5

Now i am able to add basic authentication to har proxy when using http
But when i want to use https it is not working anymore…

0 Likes

#6

Share the configuration please.

0 Likes