Score:0

How to set header in request for HAProxy based on script output?

in flag

I have haproxy which runs fine, but we have backend, which validate token against our identity service.

I want to move that logic to HAProxy, where we can run some python or sh script, and get the user name and its ldap groups.

Then we don't have to check for token in each services. We just have to check it the user request has that username and ldapgroup headers or not. If its not, backend will not server the request.

I was checking on google, found some leads like there is add-header and set-header to update the headers info in request or response.

I also found the external_check which will execute script and take decision.

What I am looking for is combination of add-header/set-header and external-check? Where it will execute the script and set the headers.

Michael Hampton avatar
cz flag
`external_check` allows for a custom _health check_ only. If it fails the backend is taken out as unhealthy.
Nilesh avatar
in flag
Thanks @MichaelHampton, I am looking to set some headers based on some script, is there any way to do that ?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.