You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Antony Stone <An...@apache.open.source.it> on 2020/02/05 11:45:01 UTC

[users@httpd] Health check expressions

Hi.

I'm using Apache as a load-balancing proxy, following 
https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html and 
https://httpd.apache.org/docs/2.4/mod/mod_proxy_hcheck.html as guides to 
setting it up.

I've got it working fine when I use %{REQUEST_STATUS} in the health check 
expression, but I'd like to use the content type of the returned header for 
the health check.

Following the "expression" link from the hcheck page and looking at 
https://httpd.apache.org/docs/2.4/expr.html I think I should be able to use 
%{CONTENT_TYPE} but this always returns status HcFl.

Is there a list of what I can use in ProxyHCExpr definitions somewhere, other 
than the two examples (request status, and body content) shown on the above 
page?

Any idea how to check the content-type of the returned response?


Thanks,


Antony.

-- 
Normal people think "If it ain't broke, don't fix it".
Engineers think "If it ain't broke, it doesn't have enough features yet".

                                                   Please reply to the list;
                                                         please *don't* CC me.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Health check expressions

Posted by Antony Stone <An...@apache.open.source.it>.
On Thursday 13 February 2020 at 13:38:40, Eric Covener wrote:

> On Thu, Feb 13, 2020 at 7:30 AM Antony Stone wrote:
> > On Thursday 13 February 2020 at 13:16:19, Eric Covener wrote:
> > > On Wed, Feb 5, 2020 at 6:45 AM Antony Stone wrote:
> > > > 
> > > > Any idea how to check the content-type of the returned response?
> > > 
> > > Have you tried reading the value of the Content-Type response header
> > > instead of this built-in var?
> > 
> > No - how would I do that?
> > 
> > What should I use for ProxyHCExpr to achieve this?
> 
> Sorry I can't easily test it.  you'd use the resp() function w/ that
> header as the parameter.

I'm still not quite sure what you mean, since
https://httpd.apache.org/docs/2.4/mod/mod_proxy_hcheck.html says nothing about 
a resp() function, but I'll see whether 
https://httpd.apache.org/docs/2.4/expr.html is enough to go on.


Regards,


Antony.

-- 
Users don't know what they want until they see what they get.

                                                   Please reply to the list;
                                                         please *don't* CC me.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Health check expressions

Posted by Eric Covener <co...@gmail.com>.
On Thu, Feb 13, 2020 at 7:30 AM Antony Stone
<An...@apache.open.source.it> wrote:
>
> On Thursday 13 February 2020 at 13:16:19, Eric Covener wrote:
>
> > On Wed, Feb 5, 2020 at 6:45 AM Antony Stone wrote:
> > > Hi.
> > >
> > > I'm using Apache as a load-balancing proxy, following
> > > https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html and
> > > https://httpd.apache.org/docs/2.4/mod/mod_proxy_hcheck.html as guides to
> > > setting it up.
> > >
> > > I've got it working fine when I use %{REQUEST_STATUS} in the health check
> > > expression, but I'd like to use the content type of the returned header
> > > for the health check.
> > >
> > > Following the "expression" link from the hcheck page and looking at
> > > https://httpd.apache.org/docs/2.4/expr.html I think I should be able to
> > > use %{CONTENT_TYPE} but this always returns status HcFl.
> > >
> > > Is there a list of what I can use in ProxyHCExpr definitions somewhere,
> > > other than the two examples (request status, and body content) shown on
> > > the above page?
> > >
> > > Any idea how to check the content-type of the returned response?
> >
> > Have you tried reading the value of the Content-Type response header
> > instead of this built-in var?
>
> No - how would I do that?
>
> What should I use for ProxyHCExpr to achieve this?

Sorry I can't easily test it.  you'd use the resp() function w/ that
header as the parameter.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Health check expressions

Posted by Antony Stone <An...@apache.open.source.it>.
On Thursday 13 February 2020 at 13:16:19, Eric Covener wrote:

> On Wed, Feb 5, 2020 at 6:45 AM Antony Stone wrote:
> > Hi.
> > 
> > I'm using Apache as a load-balancing proxy, following
> > https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html and
> > https://httpd.apache.org/docs/2.4/mod/mod_proxy_hcheck.html as guides to
> > setting it up.
> > 
> > I've got it working fine when I use %{REQUEST_STATUS} in the health check
> > expression, but I'd like to use the content type of the returned header
> > for the health check.
> > 
> > Following the "expression" link from the hcheck page and looking at
> > https://httpd.apache.org/docs/2.4/expr.html I think I should be able to
> > use %{CONTENT_TYPE} but this always returns status HcFl.
> > 
> > Is there a list of what I can use in ProxyHCExpr definitions somewhere,
> > other than the two examples (request status, and body content) shown on
> > the above page?
> > 
> > Any idea how to check the content-type of the returned response?
> 
> Have you tried reading the value of the Content-Type response header
> instead of this built-in var?

No - how would I do that?

What should I use for ProxyHCExpr to achieve this?


Thanks,

Antony.

-- 
Most people are aware that the Universe is big.

 - Paul Davies, Professor of Theoretical Physics

                                                   Please reply to the list;
                                                         please *don't* CC me.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Health check expressions

Posted by Eric Covener <co...@gmail.com>.
On Wed, Feb 5, 2020 at 6:45 AM Antony Stone
<An...@apache.open.source.it> wrote:
>
> Hi.
>
> I'm using Apache as a load-balancing proxy, following
> https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html and
> https://httpd.apache.org/docs/2.4/mod/mod_proxy_hcheck.html as guides to
> setting it up.
>
> I've got it working fine when I use %{REQUEST_STATUS} in the health check
> expression, but I'd like to use the content type of the returned header for
> the health check.
>
> Following the "expression" link from the hcheck page and looking at
> https://httpd.apache.org/docs/2.4/expr.html I think I should be able to use
> %{CONTENT_TYPE} but this always returns status HcFl.
>
> Is there a list of what I can use in ProxyHCExpr definitions somewhere, other
> than the two examples (request status, and body content) shown on the above
> page?
>
> Any idea how to check the content-type of the returned response?

Have you tried reading the value of the Content-Type response header
instead of this built-in var?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Health check expressions

Posted by Antony Stone <An...@apache.open.source.it>.
Does nobody have an idea about this?

Any suggestions where else I can ask (developer list etc)?

On Wednesday 05 February 2020 at 12:45:01, Antony Stone wrote:

> Hi.
> 
> I'm using Apache as a load-balancing proxy, following
> https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html and
> https://httpd.apache.org/docs/2.4/mod/mod_proxy_hcheck.html as guides to
> setting it up.
> 
> I've got it working fine when I use %{REQUEST_STATUS} in the health check
> expression, but I'd like to use the content type of the returned header for
> the health check.
> 
> Following the "expression" link from the hcheck page and looking at
> https://httpd.apache.org/docs/2.4/expr.html I think I should be able to use
> %{CONTENT_TYPE} but this always returns status HcFl.
> 
> Is there a list of what I can use in ProxyHCExpr definitions somewhere,
> other than the two examples (request status, and body content) shown on
> the above page?
> 
> Any idea how to check the content-type of the returned response?
> 
> 
> Thanks,
> 
> 
> Antony.

-- 
2 days of trial and error can easily save you 5 minutes spent reading the 
manual.

                                                   Please reply to the list;
                                                         please *don't* CC me.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org