Apache SetEnvIf Logical AND with Two Variables

In trying to adjust the method of logging in Apache, it was found logical to have the configuration perform an AND on two variables to validate one format vs another. I had not found much detail on this, until making my way to: http://stephane.lesimple.fr/blog/2010-01-28/apache-logical-or-and-conditions-with-setenvif.html. From the page archived, I had the following:

In my example, it was not able to work as shown above, but not of by much.  We quoted the last 0 in the lines we had written, giving us the following example:

When tested, requests coming from the LB IP are listed as trusted, and only trusted requests are adjusted and trusted as having been forwarded.  Other requests, we can assume (based on topology) with x-forwarded-for header are identified as falsified.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *