/ Zope / Apsis / Pound Mailing List / Archive / 2006 / 2006-08 / RewriteLocation issue, Pound 2.1

[ << ] [ >> ]

[ possible SSH proxy? / Brandon Saxe ... ] [ SSL/Zope Question / beno <zope(at)2012.vi> ]

RewriteLocation issue, Pound 2.1
KOZMAN Balint <bkozman(at)imind.hu>
2006-08-23 11:32:29 [ FULL ]
Hi there,

I came across the following issue: I use pound as a front of two apache
backends. Pound listens on port 80, apache listens on port 82 on both
backends. Pound runs on the first backend node (together with apache).
Here's the relevant part of pound.cfg:

    Address		xxx.yyy.www.zzz
    Port		80
    xHTTP               0
    WebDAV              0
    HeadRequire "Host:.*xyz.com.*"
        Port    82
        Port    82

There is no problem while pound forwards requests to the apache instance
running on the same node as pound itself. However when it uses the other
backend (, then port 82 remains in the 'location' response
header (status 30x - moved permanently), which cannot be connected
directly by clients (and is undesired anyhow). I guess pound should
rewrite this response header also to use port 80 as it does when it uses
the first backend. I've checked the configuration of both apache
instances, they are the same. Any suggestion to resolve this issue would
highly be appreciated.


Re: [Pound Mailing List] RewriteLocation issue, Pound 2.1
"Richard Hamilton" <ricky.hamilton(at)btopenworld.com>
2006-08-23 12:39:48 [ FULL ]
I think that this could  be another manifestation of the same problem that 
we are investigating under the heading 'URL rewriting issues'.


----- Original Message ----- 
From: "KOZMAN Balint" <bkozman(at)imind.hu>
To: <pound(at)apsis.ch>
Sent: Wednesday, August 23, 2006 10:32 AM
Subject: [Pound Mailing List] RewriteLocation issue, Pound 2.1


Re: [Pound Mailing List] RewriteLocation issue, Pound 2.1
Robert Segall <roseg(at)apsis.ch>
2006-08-23 18:42:34 [ FULL ]
On Wed, 2006-08-23 at 11:32 +0200, KOZMAN Balint wrote:[...]

What you don't tell us, and it is important, is to which address is the
browser redirected: is it xxx.yyy.www.zzz:82, or

For everybody else: Pound 2.1 changes the Location and Content-location
headers in the following manner:

1. Conditional rewriting: the rewriting is done if the reply from the
back-end includes the headers, with content:
	- the address and port of the back-end that issued the reply
	- the address Pound is listening on but a wrong port
The default ports are supplied for http (80) and https (443).
Additionally, the request MUST include a Host header and RewriteLocation
MUST be 1 (default value).

Please note: the comparison is done at the address level, thus address
the redirect points to MUST be resolvable.

2. If the conditions are fulfilled then the contents of the affected
header are replaced by the expression proto://host/path, where:
	- proto is http or https as the case may be (ListenHTTP/S)
	- host is the value of the Host header in the request
	- path is the data path from the reply header

To the OP: I suggest you have a look at exactly what is sent to Pound
and what the replies show (use something like LiveHTTPHeader to get the
full header list). Compare that to the list above.[...]

Re: [Pound Mailing List] RewriteLocation issue, Pound 2.1
KOZMAN Balint <bkozman(at)imind.hu>
2006-08-24 20:01:07 [ FULL ]

Browser is redirected to xyz.com:82, but only when the response comes from
the node to pound. Strange is that all is fine when it comes
from (I mean that pound replaces port 82 with 80 correctly
in Location headers).

Being desperate I played a bit with the 'UseCanonicalName' directive of
apache, but it didn't seem to give the answer.