• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1200
  • Last Modified:

SetEnvIf Config for Proxy

Hi,
I have a proxy server which serves requests from my webservers, it adds a X-Forwarded-For header to each request.
I want to be able to not log requests which come from my internal network, eg 192.168.0.x
I have this line in my httpd.conf:
SetEnvIf X-Forwarded-For "^192\.168\.0\.[0-254]$" dontlog
and then in the virtual server config:
CustomLog "|/usr/local/apache2/bin/cronolog /usr/local/apache2/logs/access_%Y-%m-%d" "combined" env=!dontlog

Where am I going wrong?
Thanks!
D.

0
maunded
Asked:
maunded
1 Solution
 
caterham_wwwCommented:
[0-254] is not a valid character class.
try

SetEnvIf X-Forwarded-For "^192\.168\.0\." dontlog
0
 
maundedAuthor Commented:
Thanks, that did the trick
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now