You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Axel-Stephane SMORGRAV <Ax...@europe.adp.com> on 2008/02/01 10:07:14 UTC

RE: [users@httpd] Apache2 rewriting HTTP headers

I see why you can suspect Apache httpd of setting these headers, but AFAIK from having used Apache 2.0.x and mod_proxy for a number of years, Apache does not "rewrite" headers unless you do so explicitly in the configuration.

You will note that in the first case the application replies HTTP/1.0 and in the second, HTTP/1.1. Did you use wget in both cases ?

Could you possibly snoop/sniff the traffic apache->server using snoop/tcpdump/ethereal ? That could shed some light on who sets the headers the way the client receives them. It would however require that you install the reverse proxy and the application on different servers.


-ascs
 
-----Message d'origine-----
De : Lucas Brasilino [mailto:lucas.brasilino@gmail.com] 
Envoyé : jeudi 31 janvier 2008 18:27
À : users@httpd.apache.org
Objet : [users@httpd] Apache2 rewriting HTTP headers

Hi!

I'm using apache 2.0.59 and I'm getting an weird problem.
First of all, I have no 'Header <blabla> unset' from mod_headers.
Apache is rewriting 'Cache-Control' and 'Pragma' headers when is being fetched _only_ PDF and DOC file. An example:
Asking direct to background server (using wget):

  1 HTTP/1.0 200 OK
  2 Server: Zope/(Zope 2.9.8-final, python 2.4.4, linux2) ZServer/1.1 Plone/2.5.3-final
  3 Date: Thu, 31 Jan 2008 17:10:19 GMT
  4 Content-Length: 49665
  5 X-Cache-Headers-Set-By: CachingPolicyManager: 
/intranets/restrito/caching_policy_manager
  6 Accept-Ranges: bytes
  7 Expires: Thu, 31 Jan 2008 17:15:19 GMT
  8 Connection: Keep-Alive
  9 X-Caching-Rule-Id: downloads
10 Cache-Control: max-age=300, must-revalidate
11 Content-Type: application/pdf
12 X-Header-Set-Id: 10

Asking to apache2:

  1 HTTP/1.1 200 OK
  2 Date: Thu, 31 Jan 2008 17:11:10 GMT
  3 Server: Zope/(Zope 2.9.8-final, python 2.4.4, linux2) ZServer/1.1 Plone/2.5.3-final
  4 Content-Length: 49665
  5 X-Cache-Headers-Set-By: CachingPolicyManager: 
/intranets/restrito/caching_policy_manager
  6 Accept-Ranges: bytes
  7 Expires: Thu, 31 Jan 2008 17:16:10 GMT
  8 X-Caching-Rule-Id: downloads
  9 Cache-Control: -
10 Content-Type: application/pdf
11 X-Header-Set-Id: 10
12 Pragma: -
13 X-Cluster-Server: plutao
14 Connection: close

Please see 'Pragma' and 'Cache-Control'.


Any help or tip how can I debug this problem ?

Configuration:
<snipet>

  RewriteEngine On
  RewriteRule ^/atlas/WEB-INF/classes/(.*)
http://otherserver.org/atlas/WEB-INF/classes/$1 [L,R=301]
  RewriteRule ^/(.*)
http://localhost:8080/VirtualHostBase/http/mybackendserver.org:80/intranets/restrito/VirtualHostRoot/$1
[L,P]

  Header set X-Cluster-Server plutao

  <IfModule mod_proxy.c>
   ProxyVia On
   <LocationMatch "^[^/]">
    Deny from all
   </LocationMatch>
  </IfModule>

</snipet>


thanks a lot in advance
Lucas Brasilino

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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] Apache2 rewriting HTTP headers

Posted by Axel-Stephane SMORGRAV <Ax...@europe.adp.com>.
Holy Molly Miss Sophie! And you say this only occurs when serving PDF and DOC files ? 

KeepAlive was a HTTP/1.0 extension, so I do not think that the Connection header violates RFC. That is besides the point here anyway...

I do not see any Age header so I do not think you are caching, are you?

I would be interested in seing your config (on Monday). Could you post it? Please strip all comments to make it more readable.

-ascs
 
-----Message d'origine-----
De : Lucas Brasilino [mailto:lucas.brasilino@gmail.com] 
Envoyé : vendredi 1 février 2008 13:13
À : users@httpd.apache.org
Objet : Re: [users@httpd] Apache2 rewriting HTTP headers

Hi Axel-Stephane!

> I see why you can suspect Apache httpd of setting these headers, but 
> AFAIK from having used Apache 2.0.x
 > and mod_proxy for a number of years, Apache does not "rewrite" 
headers unless you do so explicitly in the  > configuration.

I agree but, really, I can't figure out. Theres no such directives in my configuration. But I gonna check out by the third time. The odd thing is that other files, like GIF and JPG which also backend server generates the 'Cache-Control' this rewrite doesn't happens.

> You will note that in the first case the application replies HTTP/1.0 
> and in the second, HTTP/1.1. Did you use wget in both cases ?

Yes, I did. Maybe due a 'KeepAlive On' in apache....

By the way, wget uses HTTP 1.0 with a 'Connection' header. it is a violation, isn't it?

> Could you possibly snoop/sniff the traffic apache->server using snoop/tcpdump/ethereal ?
> That could shed some light on who sets the headers the way the client receives them.
> It would however require that you install the reverse proxy and the application on different servers.

Here comes wget->apache connection:

GET /srh/pos-graduacao/docs-inscricao/ficha_de_inscricao.pdf HTTP/1.0
User-Agent: Wget/1.9.1
Host:  myfrontendserver.org
Accept: */*
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Fri, 01 Feb 2008 12:01:23 GMT
Server: Zope/(Zope 2.9.8-final, python 2.4.4, linux2) ZServer/1.1 Plone/2.5.3-final
Content-Length: 49665
X-Cache-Headers-Set-By: CachingPolicyManager: 
/intranets/restrito/caching_policy_manager
Accept-Ranges: bytes
Expires: Fri, 01 Feb 2008 12:06:25 GMT
X-Caching-Rule-Id: downloads
Cache-Control: -
Content-Type: application/pdf
X-Header-Set-Id: 10
Via: 1.0 myfrontendserver.org
Pragma: -
X-Cluster-Server: plutao
Connection: close

Here comes the apache->server connection:

  GET
/VirtualHostBase/http/mybackendserver.org:80/intranets/restrito/VirtualHostRoot/srh/pos-graduacao/docs-inscricao/ficha_de_incricao.pdf
HTTP/1.1
  Host: localhost:9080
  User-Agent: Wget/1.9.1
  Accept: */*
  Max-Forwards: 10
  Via: 1.0 myfrontendserver.org
  X-Forwarded-For: AAA.BBB.CCC.DDD
  X-Forwarded-Host: myfrontendserver.org
  X-Forwarded-Server: myfrontendserver.org

  HTTP/1.1 200 OK
  Server: Zope/(Zope 2.9.8-final, python 2.4.4, linux2) ZServer/1.1 Plone/2.5.3-final
  Date: Fri, 01 Feb 2008 11:36:26 GMT
  Content-Length: 49665
  X-Cache-Headers-Set-By: CachingPolicyManager: 
/intranets/restrito/caching_policy_manager
  Accept-Ranges: bytes
  Expires: Fri, 01 Feb 2008 11:41:26 GMT
  X-Caching-Rule-Id: downloads
  Cache-Control: max-age=300, must-revalidate
  Content-Type: application/pdf
  X-Header-Set-Id: 10

Thanks a lot, regards
Lucas Brasilino


---------------------------------------------------------------------
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


---------------------------------------------------------------------
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] Apache2 rewriting HTTP headers

Posted by Lucas Brasilino <lu...@gmail.com>.
Hi Axel-Stephane!

> I see why you can suspect Apache httpd of setting these headers, but AFAIK from having used Apache 2.0.x
 > and mod_proxy for a number of years, Apache does not "rewrite" 
headers unless you do so explicitly in the
 > configuration.

I agree but, really, I can't figure out. Theres no such directives in
my configuration. But I gonna check out by the third time. The odd
thing is that other files, like GIF and JPG which also backend server
generates the 'Cache-Control' this rewrite doesn't happens.

> You will note that in the first case the application replies HTTP/1.0 and in
> the second, HTTP/1.1. Did you use wget in both cases ?

Yes, I did. Maybe due a 'KeepAlive On' in apache....

By the way, wget uses HTTP 1.0 with a 'Connection' header. it is a
violation, isn't it?

> Could you possibly snoop/sniff the traffic apache->server using snoop/tcpdump/ethereal ?
> That could shed some light on who sets the headers the way the client receives them.
> It would however require that you install the reverse proxy and the application on different servers.

Here comes wget->apache connection:

GET /srh/pos-graduacao/docs-inscricao/ficha_de_inscricao.pdf HTTP/1.0
User-Agent: Wget/1.9.1
Host:  myfrontendserver.org
Accept: */*
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Fri, 01 Feb 2008 12:01:23 GMT
Server: Zope/(Zope 2.9.8-final, python 2.4.4, linux2) ZServer/1.1 
Plone/2.5.3-final
Content-Length: 49665
X-Cache-Headers-Set-By: CachingPolicyManager: 
/intranets/restrito/caching_policy_manager
Accept-Ranges: bytes
Expires: Fri, 01 Feb 2008 12:06:25 GMT
X-Caching-Rule-Id: downloads
Cache-Control: -
Content-Type: application/pdf
X-Header-Set-Id: 10
Via: 1.0 myfrontendserver.org
Pragma: -
X-Cluster-Server: plutao
Connection: close

Here comes the apache->server connection:

  GET 
/VirtualHostBase/http/mybackendserver.org:80/intranets/restrito/VirtualHostRoot/srh/pos-graduacao/docs-inscricao/ficha_de_incricao.pdf 
HTTP/1.1
  Host: localhost:9080
  User-Agent: Wget/1.9.1
  Accept: */*
  Max-Forwards: 10
  Via: 1.0 myfrontendserver.org
  X-Forwarded-For: AAA.BBB.CCC.DDD
  X-Forwarded-Host: myfrontendserver.org
  X-Forwarded-Server: myfrontendserver.org

  HTTP/1.1 200 OK
  Server: Zope/(Zope 2.9.8-final, python 2.4.4, linux2) ZServer/1.1 
Plone/2.5.3-final
  Date: Fri, 01 Feb 2008 11:36:26 GMT
  Content-Length: 49665
  X-Cache-Headers-Set-By: CachingPolicyManager: 
/intranets/restrito/caching_policy_manager
  Accept-Ranges: bytes
  Expires: Fri, 01 Feb 2008 11:41:26 GMT
  X-Caching-Rule-Id: downloads
  Cache-Control: max-age=300, must-revalidate
  Content-Type: application/pdf
  X-Header-Set-Id: 10

Thanks a lot, regards
Lucas Brasilino


---------------------------------------------------------------------
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