Need configuration for redirekt to proxy with authentication

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

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 ?

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

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).

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…

Share the configuration please.