You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Bhattacharya, Sudip" <su...@genpact.com> on 2012/10/26 17:17:21 UTC

[users@httpd] How to debug SetEnvIfNoCase command?

Hi,

I am facing issues with SetEnvIfNoCase command. Can you help me on how to debug it? I have set my log level to debug, but not seeing any evaluation details there.

The problem I am facing is with the below set of commands.

#enable gzip for all
SetOutputFilter DEFLATE
#assume that user is local
SetEnv UserIs=local
#check for custom header "RemoteUser=remote" set by remote proxy apache, to check if user is local or coming via remote apache proxy.
#this condition is running even if the RemoteUser http header is not present in the request
SetEnvIfNoCase RemoteUser remote !UserIs
#disable gzip for local users, it should run only for remote users
SetEnvIfNoCase UserIs local no-gzip dont-vary

Stragely, all users are getting gzipped data. While I feel the above commands should disable gzip if users are local.
What am I doing wrong?

______________________________
Sudip Kumar Bhattacharya



This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only
by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its 
contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately 
by e-mail/phone & delete it from their system without making any copies or disclosing it to a third person.


Re: [users@httpd] How to debug SetEnvIfNoCase command?

Posted by Tom Evans <te...@googlemail.com>.
On Mon, Oct 29, 2012 at 8:31 AM, Bhattacharya, Sudip
<su...@genpact.com> wrote:
> This should be documented clearly in the apache manuals for SetEnv and SetEnvIf.

It is:

http://httpd.apache.org/docs/2.2/env.html#caveats

Cheers

Tom

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


RE: [users@httpd] How to debug SetEnvIfNoCase command?

Posted by "Bhattacharya, Sudip" <su...@genpact.com>.
Wow. I spent about a week trying to find out why my script is not working. All the time I was trying out different variables/headers and thinking that my regex might be the cause of the issues.
Thanks a lot Eric for pointing out the issue.
This should be documented clearly in the apache manuals for SetEnv and SetEnvIf.

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Friday, October 26, 2012 9:58 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] How to debug SetEnvIfNoCase command?

On Fri, Oct 26, 2012 at 12:10 PM, Bhattacharya, Sudip <su...@genpact.com> wrote:
> Sorry, could not get your statement.
> Are you saying that SetEnvIf is executed before SetEnv even if the SetEnv statement is coming before SetEnvIf in the configuration?

Yes.

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

This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only
by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its 
contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately 
by e-mail/phone & delete it from their system without making any copies or disclosing it to a third person.


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


Re: [users@httpd] How to debug SetEnvIfNoCase command?

Posted by Eric Covener <co...@gmail.com>.
On Fri, Oct 26, 2012 at 12:10 PM, Bhattacharya, Sudip
<su...@genpact.com> wrote:
> Sorry, could not get your statement.
> Are you saying that SetEnvIf is executed before SetEnv even if the SetEnv statement is coming before SetEnvIf in the configuration?

Yes.

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


RE: [users@httpd] How to debug SetEnvIfNoCase command?

Posted by "Bhattacharya, Sudip" <su...@genpact.com>.
Sorry, could not get your statement.
Are you saying that SetEnvIf is executed before SetEnv even if the SetEnv statement is coming before SetEnvIf in the configuration?

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Friday, October 26, 2012 9:19 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] How to debug SetEnvIfNoCase command?

> #assume that user is local
> SetEnv UserIs=local

this runs later than SetEnvIf.  Don't mix them and refer to the same variables.

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

This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only
by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its 
contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately 
by e-mail/phone & delete it from their system without making any copies or disclosing it to a third person.


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


Re: [users@httpd] How to debug SetEnvIfNoCase command?

Posted by Eric Covener <co...@gmail.com>.
> #assume that user is local
> SetEnv UserIs=local

this runs later than SetEnvIf.  Don't mix them and refer to the same variables.

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