You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gordon Mohr <go...@archive.org> on 2008/09/24 01:49:19 UTC

[users@httpd] mod-headers 'early' keyword working in 2.2.4?

I'm trying to use the 'early' keyword on a Header directive in Apache 
2.2.4 on Ubuntu, and having no success.

My first attempt was:

Header unset MyHeader early

And I got an error: "header unset takes two arguments"

OK, I thought, maybe 'unset' is special (even though I'd really like to 
use it 'early'.) So I tried:

Header set MyHeader myvalue early

And I got an error: "error: envclause should be in the form env=envar"

I don't see any indication in the docs 'early' is a recent (post-2.2.4) 
addition, though that second error suggests

Is anyone using mod_header Header 'early' successfully?

Any ideas what I'm doing wrong, if anything?

Thanks for any help,

- Gordon @ IA

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Update: really on 2.2.4, can't unset or edit 'Expires' (was Re: [users@httpd] mod-headers 'early' keyword working in 2.2.4?

Posted by Gordon Mohr <go...@archive.org>.
Nick Kew wrote:
> On Tue, 23 Sep 2008 18:17:11 -0700
> Gordon Mohr <go...@archive.org> wrote:
> 
>>  It looked like 'early' might have
>> some chance of removing the original Expires without disturbing the 
>> mod_expires addition.
> 
> Not a chance.  It happens long before the proxy has been
> contacted, let alone sent you an Expires header.
> 
> You need Header edit.  And an upgrade to 2.2.x.

Hmm. I'm beginning to wonder if the situations where any of the 'Header' 
directives can change an existing header are very limited.

I've moved to the inner server (not the inbound proxy, but the machine 
being proxied-to), which is truly running 2.2.4. A Perl CGI that I'd 
prefer not to disturb is generating the unwanted 'Expires' header.

None of the following in the Apache configuration (each tried 
independently) work to remove or change the header on the outbound 
response:

Header unset Expires

header set Expires foo

Header edit Expires ^.*$ foo

However, setting other headers works (so it's not a simple matter of the 
directives being placed in the wrong place).

Are there cases in which a CGI's returned headers are unchangeable by 
mod_headers?

- Gordon @ IA

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod-headers 'early' keyword working in 2.2.4?

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 23 Sep 2008 18:17:11 -0700
Gordon Mohr <go...@archive.org> wrote:

>  It looked like 'early' might have
> some chance of removing the original Expires without disturbing the 
> mod_expires addition.

Not a chance.  It happens long before the proxy has been
contacted, let alone sent you an Expires header.

You need Header edit.  And an upgrade to 2.2.x.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod-headers 'early' keyword working in 2.2.4?

Posted by Gordon Mohr <go...@archive.org>.
Nick Kew wrote:
> On Tue, 23 Sep 2008 16:49:19 -0700
> Gordon Mohr <go...@archive.org> wrote:
> 
>> Any ideas what I'm doing wrong, if anything?
> 
> Sounds like you're using an older Apache version than you think:
> that's exactly what I'd expect from Apache 2.0.x, which didn't
> support the "early" keyword.

Indeed, I'd been misled by a Server header it was forwarding from 
another server. It is 2.0.x. That explains the errors.  Thanks!

> Why do you want early?  It's there as an aid for developers
> rather than for operational use.  And if you're a developer,
> why aren't you using the source?

Motivation for 'early':

The server in question is proxying to another server which often 
provides a bad Expires header. I'd like to strip that header and replace 
it with a new Expires, +1 day.

Using mod_expires alone only seems to add the Expires header on proxied 
responses when it isn't already present.

Using 'Header unset Expires', in any order relative to the Expires 
directives, removes all Expires. It looked like 'early' might have some 
chance of removing the original Expires without disturbing the 
mod_expires addition.

Any other ideas for achieving the desired effect only via configuration 
on the proxying Apache?

I saw the note that 'early' is intended as "a test/debugging aid for 
developers", but the followup description -- that the headers can be 
further changed by other modules -- is exactly the effect I need. Since 
not even the source I viewed suggested any further risks to using 
'early' operationally, it seemed worth a try.

- Gordon @ IA


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod-headers 'early' keyword working in 2.2.4?

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 23 Sep 2008 16:49:19 -0700
Gordon Mohr <go...@archive.org> wrote:

> Any ideas what I'm doing wrong, if anything?

Sounds like you're using an older Apache version than you think:
that's exactly what I'd expect from Apache 2.0.x, which didn't
support the "early" keyword.

Why do you want early?  It's there as an aid for developers
rather than for operational use.  And if you're a developer,
why aren't you using the source?

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org