httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krzysztof Dajka <alter...@gmail.com>
Subject [users@httpd] Negation of Remote_Addr in SetEnvIf directive
Date Thu, 22 Apr 2010 11:00:29 GMT
Hi,

I have a bunch of apache servers which are load balanced. I have configured
them in such manner that each server adds header
X-Server-Name with proper hostname.

In my apache.conf I have:

PassEnv HOSTNAME
Header add X-Server-Name "%{HOSTNAME}e"

I have exported HOSTNAME before launching apache and everything works as it
should.
But I would like to configure apache to show hostname only for my inner
network 10.
So I added SetEnvIf:

PassEnv HOSTNAME
SetEnvIf Remote_Addr !^10\. HOSTNAME=foo.bar.com
Header add X-Server-Name "%{HOSTNAME}e"

but negation of network didn't work, I have also tried:
SetEnvIf Remote_Addr [^(10\.)] HOSTNAME=foo.bar.com

but it didn't worked either.
Has anyone used negation in SetEnvIf Remote_Addr ?

Documentation says:
Syntax:    SetEnvIf attribute regex [!]env-variable[=value]
[[!]env-variable[=value]] ...

so why any of those regex's doesn't work?

Thanks in advance

Mime
View raw message