You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Amit Singla <am...@gmail.com> on 2013/08/24 21:23:04 UTC

[users@httpd] ProxyPassReverse not changing the protocol part (https to http) of the redirect url

I need to proxy http requests to https server in the backend. Everything is
working except a minor issues in redirects URLs. ProxyPassReverse
translates the the URL except the protocol i.e. does not translate https
from backend server to http protocol.

*Version: Apache/2.2.15*
*
*
Below is the configuration for reverse proxy

<VirtualHost *:8888>
ServerName frontoffice.example.com
SSLProxyEngine On
ProxyPreserveHost On
ProxyPass /shop https://backend.example.com:9443/shop
ProxyPassReverse /shop  https://backend.example.com:9443/shop
</VirtualHost>

e.g.
http://frontoffice.example.com:8888/shop/cart are proxied to
https://backend.example.com:9443/shop/cart.  The backend server results in
redirect (302) to https://backend.example.com:9443/shop/login but browser
is getting the redirect as
https://frontoffice.example.com:8888/shop/cart.

So ProxyPassReverse rewrites the URL except the protocol.

Am I missing some configurations here or this is some known issue or
expected behavior?

I will appreciate any help on this front.

Thanks

Re: [users@httpd] ProxyPassReverse not changing the protocol part (https to http) of the redirect url

Posted by Amit Singla <am...@gmail.com>.
I don't really need. it is just i need to do this  in dev for some reasons.


On Tue, Aug 27, 2013 at 9:59 AM, Shanti Suresh <sh...@umich.edu> wrote:

> Hi Amit,
>
> Why would you like to reverse proxy to an HTTPS backend and then serve the
> results back over HTTP?  Usually, when one does an HTTP to HTTPS, there is
> authentication involved, followed by secure session-related information.
>
> Thanks,
>
>                             -Shanti
>
>
>
> On Tue, Aug 27, 2013 at 6:07 AM, Igor Cicimov <ic...@gmail.com> wrote:
>
>>
>> On 25/08/2013 5:23 AM, "Amit Singla" <am...@gmail.com> wrote:
>> >
>> > I need to proxy http requests to https server in the backend.
>> Everything is working except a minor issues in redirects
>> URLs. ProxyPassReverse translates the the URL except the protocol i.e. does
>> not translate https from backend server to http protocol.
>> >
>> > Version: Apache/2.2.15
>> >
>> > Below is the configuration for reverse proxy
>> >
>> > <VirtualHost *:8888>
>> > ServerName frontoffice.example.com
>> > SSLProxyEngine On
>> > ProxyPreserveHost On
>> > ProxyPass /shop https://backend.example.com:9443/shop
>> > ProxyPassReverse /shop  https://backend.example.com:9443/shop
>> > </VirtualHost>
>> >
>> > e.g.
>> > http://frontoffice.example.com:8888/shop/cart are proxied to
>> https://backend.example.com:9443/shop/cart.  The backend server results
>> in redirect (302) to https://backend.example.com:9443/shop/login but
>> browser is getting the redirect as
>> > https://frontoffice.example.com:8888/shop/cart.
>> >
>> > So ProxyPassReverse rewrites the URL except the protocol.
>> >
>> > Am I missing some configurations here or this is some known issue or
>> expected behavior?
>> >
>> Two things:
>> 1. I dont see "ProxyRequest off" in your snipet which is needed for
>> reverse proxy
>> 2. You can try rewriting the Location header something like this
>>
>> Header edit Location ^https://(.*)$ http://$1
>>
>> > I will appreciate any help on this front.
>> >
>> > Thanks
>> >
>> >
>> >
>> >
>> >
>> >
>>
>
>
>
>
>


-- 
Sent from my Nokia 1100 :)

Re: [users@httpd] ProxyPassReverse not changing the protocol part (https to http) of the redirect url

Posted by Shanti Suresh <sh...@umich.edu>.
Hi Amit,

Why would you like to reverse proxy to an HTTPS backend and then serve the
results back over HTTP?  Usually, when one does an HTTP to HTTPS, there is
authentication involved, followed by secure session-related information.

Thanks,

                            -Shanti


On Tue, Aug 27, 2013 at 6:07 AM, Igor Cicimov <ic...@gmail.com> wrote:

>
> On 25/08/2013 5:23 AM, "Amit Singla" <am...@gmail.com> wrote:
> >
> > I need to proxy http requests to https server in the backend. Everything
> is working except a minor issues in redirects URLs. ProxyPassReverse
> translates the the URL except the protocol i.e. does not translate https
> from backend server to http protocol.
> >
> > Version: Apache/2.2.15
> >
> > Below is the configuration for reverse proxy
> >
> > <VirtualHost *:8888>
> > ServerName frontoffice.example.com
> > SSLProxyEngine On
> > ProxyPreserveHost On
> > ProxyPass /shop https://backend.example.com:9443/shop
> > ProxyPassReverse /shop  https://backend.example.com:9443/shop
> > </VirtualHost>
> >
> > e.g.
> > http://frontoffice.example.com:8888/shop/cart are proxied to
> https://backend.example.com:9443/shop/cart.  The backend server results
> in redirect (302) to https://backend.example.com:9443/shop/login but
> browser is getting the redirect as
> > https://frontoffice.example.com:8888/shop/cart.
> >
> > So ProxyPassReverse rewrites the URL except the protocol.
> >
> > Am I missing some configurations here or this is some known issue or
> expected behavior?
> >
> Two things:
> 1. I dont see "ProxyRequest off" in your snipet which is needed for
> reverse proxy
> 2. You can try rewriting the Location header something like this
>
> Header edit Location ^https://(.*)$ http://$1
>
> > I will appreciate any help on this front.
> >
> > Thanks
> >
> >
> >
> >
> >
> >
>

Re: [users@httpd] ProxyPassReverse not changing the protocol part (https to http) of the redirect url

Posted by Igor Cicimov <ic...@gmail.com>.
On 25/08/2013 5:23 AM, "Amit Singla" <am...@gmail.com> wrote:
>
> I need to proxy http requests to https server in the backend. Everything
is working except a minor issues in redirects URLs. ProxyPassReverse
translates the the URL except the protocol i.e. does not translate https
from backend server to http protocol.
>
> Version: Apache/2.2.15
>
> Below is the configuration for reverse proxy
>
> <VirtualHost *:8888>
> ServerName frontoffice.example.com
> SSLProxyEngine On
> ProxyPreserveHost On
> ProxyPass /shop https://backend.example.com:9443/shop
> ProxyPassReverse /shop  https://backend.example.com:9443/shop
> </VirtualHost>
>
> e.g.
> http://frontoffice.example.com:8888/shop/cart are proxied to
https://backend.example.com:9443/shop/cart.  The backend server results in
redirect (302) to https://backend.example.com:9443/shop/login but browser
is getting the redirect as
> https://frontoffice.example.com:8888/shop/cart.
>
> So ProxyPassReverse rewrites the URL except the protocol.
>
> Am I missing some configurations here or this is some known issue or
expected behavior?
>
Two things:
1. I dont see "ProxyRequest off" in your snipet which is needed for reverse
proxy
2. You can try rewriting the Location header something like this

Header edit Location ^https://(.*)$ http://$1

> I will appreciate any help on this front.
>
> Thanks
>
>
>
>
>
>

[users@httpd] Re: ProxyPassReverse not changing the protocol part (https to http) of the redirect url

Posted by Amit Singla <am...@gmail.com>.
Any help or pointer on this? Thanks.


On Sat, Aug 24, 2013 at 3:23 PM, Amit Singla <am...@gmail.com> wrote:

> I need to proxy http requests to https server in the backend. Everything
> is working except a minor issues in redirects URLs. ProxyPassReverse
> translates the the URL except the protocol i.e. does not translate https
> from backend server to http protocol.
>
> *Version: Apache/2.2.15*
> *
> *
> Below is the configuration for reverse proxy
>
> <VirtualHost *:8888>
> ServerName frontoffice.example.com
> SSLProxyEngine On
> ProxyPreserveHost On
> ProxyPass /shop https://backend.example.com:9443/shop
> ProxyPassReverse /shop  https://backend.example.com:9443/shop
> </VirtualHost>
>
> e.g.
> http://frontoffice.example.com:8888/shop/cart are proxied to
> https://backend.example.com:9443/shop/cart.  The backend server results
> in redirect (302) to https://backend.example.com:9443/shop/login but
> browser is getting the redirect as
> https://frontoffice.example.com:8888/shop/cart.
>
> So ProxyPassReverse rewrites the URL except the protocol.
>
> Am I missing some configurations here or this is some known issue or
> expected behavior?
>
> I will appreciate any help on this front.
>
> Thanks
>
>
>
>
>
>
>


-- 
Sent from my Nokia 1100 :)