On Tue, Apr 26, 2022 at 03:34:32PM +0200, Aleksandar Lazic wrote:
> On Tue, 26 Apr 2022 15:03:51 +0200
> Valerio Pachera <siri...@gmail.com> wrote:
> 
> > Hi, I have several backend configuration that make use of a custom script:
> > 
> > external-check command 'custom-script.sh'
> > 
> > The script read uses the environment variables such as $HAPROXY_PROXY_NAME.
> > I would like to be able to set and environment variable in the backend
> > declaration, before running the external check.
> > This environment variable will change the behavior of custom-script.sh.
> > 
> > Is it possible to declare environment variables in haproxy 1.9 or later?
> > 
> > What I need is to make custom-script.sh aware if SSL is used or not.
> > If there's another way to achieve that, please tell me.
> 
> Well you can put it in the name of the server as I don't see any other option
> to add extra variables into the external check.

It's possible to set variables in the global section using "setenv"
and "presetenv", please refer to the doc for these.

Willy

Reply via email to