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/09/18 13:53:31 UTC
[users@httpd] httpd 2.2 ReverseProxy not working on 302 redirect location header
Hi,
I am using an apache setup as a reverse proxy to a backend server.
...
<VirtualHost *>
ServerName foolocal.com
ProxyPass / http://fooremote.com/
ProxyPassReverse / http://fooremote.com/
...
The above setup is working fine for most pages, except a few servlets which are using 302 Redirects.
There is a servlet in the backend system, which is setting a redirect header like below:
HTTP/1.1 302 Moved Temporarily
Location: http://fooremote.com:80/abc.jsp
The ReverseProxy is not able to reset the value of the Location header in this case.
I tried the below option but it did not work. The original header is not modified by the below line.
Header always edit Location ^http://fooremote.com:80 http://foolocal.com
I am not sure whether the issue is with the Location header overwriting, or whether it is because of the :80 being appended in the URL in the redirection header.
Need your help in solving this.
______________________________
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.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] httpd 2.2 ReverseProxy not working on 302 redirect
location header
Posted by Eric Covener <co...@gmail.com>.
> ProxyPassReverse / http://fooremote.com/
> Location: http://fooremote.com:80/abc.jsp
Have you tried 2nd proxypassreverse with the explicit port in the 2nd argument?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] httpd 2.2 ReverseProxy not working on 302 redirect
location header
Posted by "Mario A. del Riego" <de...@fing.edu.uy>.
El 19/09/12 12:06, Tom Evans escribió:
> On Wed, Sep 19, 2012 at 3:46 PM, Mario A. del Riego
> <de...@fing.edu.uy> wrote:
>> Supid,
>>
>> I have the same behavior, it's a bug well documented at [1].
>>
>> If you know the redirection, you can do it in the front-end.
>> In my particular case, i fixed it with mod_security. I have wrote a
>> little in my blog [0] (in spanish) about this.
>>
>>
>> [0] http://blog.makam.org/2012/09/01/bug-en-mod_proxy/
>> [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=51489
>>
>
> I don't believe this is a bug. In the configuration he says
>
> ProxyPassReverse / http://fooremote.com/
>
oops, i misread the problem.
It has nothing to do with my situation.
Sorry.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] httpd 2.2 ReverseProxy not working on 302 redirect
location header
Posted by Tom Evans <te...@googlemail.com>.
On Wed, Sep 19, 2012 at 3:46 PM, Mario A. del Riego
<de...@fing.edu.uy> wrote:
> Supid,
>
> I have the same behavior, it's a bug well documented at [1].
>
> If you know the redirection, you can do it in the front-end.
> In my particular case, i fixed it with mod_security. I have wrote a
> little in my blog [0] (in spanish) about this.
>
>
> [0] http://blog.makam.org/2012/09/01/bug-en-mod_proxy/
> [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=51489
>
I don't believe this is a bug. In the configuration he says
ProxyPassReverse / http://fooremote.com/
What this actually means is:
Every time one of the special headers has a value that starts with
the value "http://fooremote.com/", replace that value with the
canonical name of this vhost, as per canonicalisation rules.
Now, his backend generates a header with this value
"http://fooremote.com:80/wibble". This does not match the configured
value, and so therefore is not rewritten.
You are not limited to one ProxyPassReverse statement, so the OP can do this:
ProxyPass / http://fooremote.com/
ProxyPassReverse / http://fooremote.com/
ProxyPassReverse / http://fooremote.com:80/
Alternatively, OP could fix his backend so that it doesn't produce
silly output like that in headers.
Cheers
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] httpd 2.2 ReverseProxy not working on 302 redirect
location header
Posted by "Mario A. del Riego" <de...@fing.edu.uy>.
Supid,
I have the same behavior, it's a bug well documented at [1].
If you know the redirection, you can do it in the front-end.
In my particular case, i fixed it with mod_security. I have wrote a
little in my blog [0] (in spanish) about this.
[0] http://blog.makam.org/2012/09/01/bug-en-mod_proxy/
[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=51489
El 18/09/12 08:53, Bhattacharya, Sudip escribió:
> Hi,
>
> I am using an apache setup as a reverse proxy to a backend server.
> ...
> <VirtualHost *>
> ServerName foolocal.com
>
> ProxyPass / http://fooremote.com/
> ProxyPassReverse / http://fooremote.com/
> ...
>
> The above setup is working fine for most pages, except a few servlets which are using 302 Redirects.
>
> There is a servlet in the backend system, which is setting a redirect header like below:
> HTTP/1.1 302 Moved Temporarily
> Location: http://fooremote.com:80/abc.jsp
>
> The ReverseProxy is not able to reset the value of the Location header in this case.
>
> I tried the below option but it did not work. The original header is not modified by the below line.
> Header always edit Location ^http://fooremote.com:80 http://foolocal.com
>
> I am not sure whether the issue is with the Location header overwriting, or whether it is because of the :80 being appended in the URL in the redirection header.
>
> Need your help in solving this.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org