jeudi 9 février 2017

apache 2.4, nested If directives

Vote count: 0

I try to set some environment variables in apache configuration file with the following directive block givet that the header "X-Forwarded-Proto" is set.

<If "-n req('X-Forwarded-Proto')">
  SetEnv NON_EMPTY_PROTO on
  <If "req('X-Forwarded-Proto') =~ /https/">
    SetEnv HTTPS on
  </If>
  <Else>
    SetEnv HTTPS off
  </Else>
</If>

As a result the environment variable NON_EMPTY_PROTO is set as expected but the variable HTTPS is not. But if I avoid nesting just for test both variables are set as expected.

<If "-n req('X-Forwarded-Proto')">
  SetEnv NON_EMPTY_PROTO on
</If>

<If "req('X-Forwarded-Proto') =~ /https/">
  SetEnv HTTPS on
</If>
<Else>
  SetEnv HTTPS off
</Else>

Why is the inner block not validated in first example? The directives documentation does not mention anything about possible or not possible nesting.

asked 21 secs ago

Let's block ads! (Why?)



apache 2.4, nested If directives

Aucun commentaire:

Enregistrer un commentaire