You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Stéphane Jeanjean <st...@softeam.com> on 2009/09/28 11:10:49 UTC

Redirections and Reverse-Proxy

Hello,

I'm using Wicket in a backend which is behind a reverse-proxy.
I understand that Wicket does some redirections even if it's not's 
explicity requested by my code. (perhaps, here, it depends of some 
strategies, but I don't know them)

When a redirection is sent by the back-end the hostname used is the 
reverse proxy host instead of the back-end host. I would like to use the 
back-end host in this response to be able to translate the back-end host 
to front-end host in the reverse-proxy.
What I can see in the reponse :
BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy -> 
302:http://RPhost/myApp/mypage -> Browser
What I would like :
BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy -> 
302:https://RPhost/myApp/mypage -> Browser

I'm using Jetty for my server and mod_proxy in ligthtpd for the reverse 
proxy.

Any idea ?

Thanks,

Stéphane



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: RE : Redirections and Reverse-Proxy

Posted by James Carman <jc...@carmanconsulting.com>.
Have you looked at:

http://docs.codehaus.org/display/JETTY/Configuring+mod_proxy

This sounds like a jetty issue, not a Wicket issue.

On Mon, Sep 28, 2009 at 2:58 PM, Stéphane Jeanjean
<st...@softeam.com> wrote:
>
> For sure, I'm using reverse proxy and cookie rewriting, but before reverse
> proxying the hostname is not the right. I think it comes from the Jetty
> implementation for the sendRedirect() method.
>
>> -----Message d'origine-----
>> De : nino martinez wael [mailto:nino.martinez.wael@gmail.com]
>> Envoyé : lundi 28 septembre 2009 20:49
>> À : users@wicket.apache.org
>> Objet : Re: Redirections and Reverse-Proxy
>>
>>
>> Hi
>>
>> I havent had that many troubles using Apache Http and wicket.
>> As long as you remember to forward and reverse proxy + cookie
>> rewrite..
>>
>> Something like this:
>> http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Stéphane Jeanjean <st...@softeam.com>
>> Date: 2009/9/28
>> Subject: Re: Redirections and Reverse-Proxy
>> To: users@wicket.apache.org
>>
>>
>>
>> I'm not sure it's a related to wicket. I think it's related to the
>> respones.sendRedirect() implementation and how the string put
>> in the location header is build. I don't know if it's
>> standard or if it's a Jetty implementation. I have to found
>> out this implementation to understand where the host in
>> location header comes from. Or perhaps I could "override" the
>> sendRedirect method() as described here :
>> http://knowledgefolders.com/akc/servlet/DisplayServlet?url=Dis
>> playNoteMPURL&reportId=1711&ownerUserId=satya
>>
>>
>> Stéphane Jeanjean a écrit :
>>
>>
>> > I don't know, that's a part of my question. Nothing about RPhost is
>> > configured in my BEhost.
>> >
>> > Igor Vaynberg a écrit :
>> >
>> >> how does wicket know about RPhost when it issues the 302?
>> >>
>> >> -igor
>> >>
>> >> On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean
>> >> <st...@softeam.com> wrote:
>> >>
>> >>
>> >>> Hello,
>> >>>
>> >>> I'm using Wicket in a backend which is behind a reverse-proxy. I
>> >>> understand that Wicket does some redirections even if it's not's
>> >>> explicity requested by my code. (perhaps, here, it
>> depends of some
>> >>> strategies, but I
>> >>> don't know them)
>> >>>
>> >>> When a redirection is sent by the back-end the hostname
>> used is the
>> >>> reverse proxy host instead of the back-end host. I would
>> like to use
>> >>> the back-end host in this response to be able to translate the
>> >>> back-end host to front-end
>> >>> host in the reverse-proxy.
>> >>> What I can see in the reponse :
>> >>> BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy ->
>> >>> 302:http://RPhost/myApp/mypage -> Browser
>> >>> What I would like :
>> >>> BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy ->
>> >>> 302:https://RPhost/myApp/mypage -> Browser
>> >>>
>> >>> I'm using Jetty for my server and mod_proxy in ligthtpd for the
>> >>> reverse proxy.
>> >>>
>> >>> Any idea ?
>> >>>
>> >>> Thanks,
>> >>>
>> >>> Stéphane
>> >>>
>> >>>
>> >>>
>> >>>
>> --------------------------------------------------------------------
>> >>> -
>> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>> >
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE : Redirections and Reverse-Proxy

Posted by Stéphane Jeanjean <st...@softeam.com>.
For sure, I'm using reverse proxy and cookie rewriting, but before reverse
proxying the hostname is not the right. I think it comes from the Jetty
implementation for the sendRedirect() method.

> -----Message d'origine-----
> De : nino martinez wael [mailto:nino.martinez.wael@gmail.com] 
> Envoyé : lundi 28 septembre 2009 20:49
> À : users@wicket.apache.org
> Objet : Re: Redirections and Reverse-Proxy
> 
> 
> Hi
> 
> I havent had that many troubles using Apache Http and wicket. 
> As long as you remember to forward and reverse proxy + cookie 
> rewrite..
> 
> Something like this: 
> http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html
> 
> 
> 
> ---------- Forwarded message ----------
> From: Stéphane Jeanjean <st...@softeam.com>
> Date: 2009/9/28
> Subject: Re: Redirections and Reverse-Proxy
> To: users@wicket.apache.org
> 
> 
> 
> I'm not sure it's a related to wicket. I think it's related to the
> respones.sendRedirect() implementation and how the string put 
> in the location header is build. I don't know if it's 
> standard or if it's a Jetty implementation. I have to found 
> out this implementation to understand where the host in 
> location header comes from. Or perhaps I could "override" the 
> sendRedirect method() as described here : 
> http://knowledgefolders.com/akc/servlet/DisplayServlet?url=Dis
> playNoteMPURL&reportId=1711&ownerUserId=satya
> 
> 
> Stéphane Jeanjean a écrit :
> 
> 
> > I don't know, that's a part of my question. Nothing about RPhost is 
> > configured in my BEhost.
> >
> > Igor Vaynberg a écrit :
> >
> >> how does wicket know about RPhost when it issues the 302?
> >>
> >> -igor
> >>
> >> On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean 
> >> <st...@softeam.com> wrote:
> >>
> >>
> >>> Hello,
> >>>
> >>> I'm using Wicket in a backend which is behind a reverse-proxy. I 
> >>> understand that Wicket does some redirections even if it's not's 
> >>> explicity requested by my code. (perhaps, here, it 
> depends of some 
> >>> strategies, but I
> >>> don't know them)
> >>>
> >>> When a redirection is sent by the back-end the hostname 
> used is the 
> >>> reverse proxy host instead of the back-end host. I would 
> like to use 
> >>> the back-end host in this response to be able to translate the 
> >>> back-end host to front-end
> >>> host in the reverse-proxy.
> >>> What I can see in the reponse :
> >>> BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy ->
> >>> 302:http://RPhost/myApp/mypage -> Browser
> >>> What I would like :
> >>> BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy ->
> >>> 302:https://RPhost/myApp/mypage -> Browser
> >>>
> >>> I'm using Jetty for my server and mod_proxy in ligthtpd for the 
> >>> reverse proxy.
> >>>
> >>> Any idea ?
> >>>
> >>> Thanks,
> >>>
> >>> Stéphane
> >>>
> >>>
> >>>
> >>> 
> --------------------------------------------------------------------
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>>
> >>>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirections and Reverse-Proxy

Posted by nino martinez wael <ni...@gmail.com>.
Hi

I havent had that many troubles using Apache Http and wicket. As long as you
remember to forward and reverse proxy + cookie rewrite..

Something like this:
http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html



---------- Forwarded message ----------
From: Stéphane Jeanjean <st...@softeam.com>
Date: 2009/9/28
Subject: Re: Redirections and Reverse-Proxy
To: users@wicket.apache.org



I'm not sure it's a related to wicket. I think it's related to the
respones.sendRedirect() implementation and how the string put in the
location header is build. I don't know if it's standard or if it's a Jetty
implementation. I have to found out this implementation to understand where
the host in location header comes from. Or perhaps I could "override" the
sendRedirect method() as described here :
http://knowledgefolders.com/akc/servlet/DisplayServlet?url=DisplayNoteMPURL&reportId=1711&ownerUserId=satya


Stéphane Jeanjean a écrit :


> I don't know, that's a part of my question. Nothing about RPhost is
> configured in my BEhost.
>
> Igor Vaynberg a écrit :
>
>> how does wicket know about RPhost when it issues the 302?
>>
>> -igor
>>
>> On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean
>> <st...@softeam.com> wrote:
>>
>>
>>> Hello,
>>>
>>> I'm using Wicket in a backend which is behind a reverse-proxy.
>>> I understand that Wicket does some redirections even if it's not's
>>> explicity
>>> requested by my code. (perhaps, here, it depends of some strategies, but
>>> I
>>> don't know them)
>>>
>>> When a redirection is sent by the back-end the hostname used is the
>>> reverse
>>> proxy host instead of the back-end host. I would like to use the back-end
>>> host in this response to be able to translate the back-end host to
>>> front-end
>>> host in the reverse-proxy.
>>> What I can see in the reponse :
>>> BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy ->
>>> 302:http://RPhost/myApp/mypage -> Browser
>>> What I would like :
>>> BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy ->
>>> 302:https://RPhost/myApp/mypage -> Browser
>>>
>>> I'm using Jetty for my server and mod_proxy in ligthtpd for the reverse
>>> proxy.
>>>
>>> Any idea ?
>>>
>>> Thanks,
>>>
>>> Stéphane
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org

Re: Redirections and Reverse-Proxy

Posted by Stéphane Jeanjean <st...@softeam.com>.
I'm not sure it's a related to wicket. I think it's related to the 
respones.sendRedirect() implementation and how the string put in the 
location header is build. I don't know if it's standard or if it's a 
Jetty implementation. I have to found out this implementation to 
understand where the host in location header comes from. Or perhaps I 
could "override" the sendRedirect method() as described here : 
http://knowledgefolders.com/akc/servlet/DisplayServlet?url=DisplayNoteMPURL&reportId=1711&ownerUserId=satya


Stéphane Jeanjean a écrit :
>
> I don't know, that's a part of my question. Nothing about RPhost is 
> configured in my BEhost.
>
> Igor Vaynberg a écrit :
>> how does wicket know about RPhost when it issues the 302?
>>
>> -igor
>>
>> On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean
>> <st...@softeam.com> wrote:
>>  
>>> Hello,
>>>
>>> I'm using Wicket in a backend which is behind a reverse-proxy.
>>> I understand that Wicket does some redirections even if it's not's 
>>> explicity
>>> requested by my code. (perhaps, here, it depends of some strategies, 
>>> but I
>>> don't know them)
>>>
>>> When a redirection is sent by the back-end the hostname used is the 
>>> reverse
>>> proxy host instead of the back-end host. I would like to use the 
>>> back-end
>>> host in this response to be able to translate the back-end host to 
>>> front-end
>>> host in the reverse-proxy.
>>> What I can see in the reponse :
>>> BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy ->
>>> 302:http://RPhost/myApp/mypage -> Browser
>>> What I would like :
>>> BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy ->
>>> 302:https://RPhost/myApp/mypage -> Browser
>>>
>>> I'm using Jetty for my server and mod_proxy in ligthtpd for the reverse
>>> proxy.
>>>
>>> Any idea ?
>>>
>>> Thanks,
>>>
>>> Stéphane
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>     
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>>
>>   
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirections and Reverse-Proxy

Posted by Stéphane Jeanjean <st...@softeam.com>.
I don't know, that's a part of my question. Nothing about RPhost is 
configured in my BEhost.

Igor Vaynberg a écrit :
> how does wicket know about RPhost when it issues the 302?
>
> -igor
>
> On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean
> <st...@softeam.com> wrote:
>   
>> Hello,
>>
>> I'm using Wicket in a backend which is behind a reverse-proxy.
>> I understand that Wicket does some redirections even if it's not's explicity
>> requested by my code. (perhaps, here, it depends of some strategies, but I
>> don't know them)
>>
>> When a redirection is sent by the back-end the hostname used is the reverse
>> proxy host instead of the back-end host. I would like to use the back-end
>> host in this response to be able to translate the back-end host to front-end
>> host in the reverse-proxy.
>> What I can see in the reponse :
>> BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy ->
>> 302:http://RPhost/myApp/mypage -> Browser
>> What I would like :
>> BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy ->
>> 302:https://RPhost/myApp/mypage -> Browser
>>
>> I'm using Jetty for my server and mod_proxy in ligthtpd for the reverse
>> proxy.
>>
>> Any idea ?
>>
>> Thanks,
>>
>> Stéphane
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Redirections and Reverse-Proxy

Posted by Igor Vaynberg <ig...@gmail.com>.
how does wicket know about RPhost when it issues the 302?

-igor

On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean
<st...@softeam.com> wrote:
> Hello,
>
> I'm using Wicket in a backend which is behind a reverse-proxy.
> I understand that Wicket does some redirections even if it's not's explicity
> requested by my code. (perhaps, here, it depends of some strategies, but I
> don't know them)
>
> When a redirection is sent by the back-end the hostname used is the reverse
> proxy host instead of the back-end host. I would like to use the back-end
> host in this response to be able to translate the back-end host to front-end
> host in the reverse-proxy.
> What I can see in the reponse :
> BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy ->
> 302:http://RPhost/myApp/mypage -> Browser
> What I would like :
> BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy ->
> 302:https://RPhost/myApp/mypage -> Browser
>
> I'm using Jetty for my server and mod_proxy in ligthtpd for the reverse
> proxy.
>
> Any idea ?
>
> Thanks,
>
> Stéphane
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org