Re: [Lift] Context path, proxies Lift

2010-02-17 Thread Jeppe Nejsum Madsen
Ok, I think I got this working, at least in a local POC.

Tim got the idea to use Jetty's virtual hosting as described here:
http://docs.codehaus.org/display/JETTY/Virtual+hosts. This allows each
app to be running in the root context within the virtual host.

Nginx only sends HTTP/1.0 requests to a backend, but adding the Host:
header seems to be interpreted by Jetty even when handling HTTP/1.0
requests. Not sure if this is mandated by the spec though.

I still think this is a little more complicated than it has to be. I
can see Wicket has had the same issues:
http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html
(See Why this doesn't always work) I think they solve it by either:

1) Always generate relative URLs, or
2) Be able to specify the context used for generated URLs (note this
is different from the current LiftRules.calculateContextPath that is
used for both incoming and outgoing requests)

But it seems I got a solution now, so this is not super urgent (for me :-)

Once again, thanks Tim!

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Context path, proxies Lift

2010-02-17 Thread Timothy Perrett
Yeah, tbh, i've always worked around the issue using relative urls... but I 
wasn't sure how much of an issue that was for you (in a big codebase, going 
around converting links is not something you want to have to do).

Glad that worked for you

Cheers, Tim


On 17 Feb 2010, at 19:43, Jeppe Nejsum Madsen wrote:

 Ok, I think I got this working, at least in a local POC.
 
 Tim got the idea to use Jetty's virtual hosting as described here:
 http://docs.codehaus.org/display/JETTY/Virtual+hosts. This allows each
 app to be running in the root context within the virtual host.
 
 Nginx only sends HTTP/1.0 requests to a backend, but adding the Host:
 header seems to be interpreted by Jetty even when handling HTTP/1.0
 requests. Not sure if this is mandated by the spec though.
 
 I still think this is a little more complicated than it has to be. I
 can see Wicket has had the same issues:
 http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html
 (See Why this doesn't always work) I think they solve it by either:
 
 1) Always generate relative URLs, or
 2) Be able to specify the context used for generated URLs (note this
 is different from the current LiftRules.calculateContextPath that is
 used for both incoming and outgoing requests)
 
 But it seems I got a solution now, so this is not super urgent (for me :-)
 
 Once again, thanks Tim!
 
 /Jeppe
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Context path, proxies Lift

2010-02-17 Thread Jeppe Nejsum Madsen
Timothy Perrett timo...@getintheloop.eu writes:

 Yeah, tbh, i've always worked around the issue using relative urls... but I 
 wasn't sure how much of an issue that was for you (in a big codebase, going 
 around converting links is not something you want to have to do).

The problem is not so much in my own code, but in the URIs that is
generated by Lift in e.g RedirectReponse. Which is why I think this
should be supported somehow.

 Glad that worked for you

Me too :-)

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] Context path, proxies Lift

2010-02-16 Thread Jeppe Nejsum Madsen
Hi,

I want to setup a single nginx in front of two independent lift apps
(see previous thread) but haven't succeeded.
What I wan't is this:

External url foo.com/index.html goes to jetty: localhost:8080/foo/index.html
External url bar.com/index.html goes to jetty: localhost:8080/bar/index.html

So, I'm trying to see if I can get the basic jetty setup going before
throwing nginx in the mix.

Here are my findings:

With LiftRules.calculateContextPath = () = Empty:

Deploying lift app foo in context foo works fine: ie
localhost:8080/foo/index.html gives me the app and the app works with
the localhost:8080/foo prefix

Not surprisingly, setting  LiftRules.calculateContextPath = () =
Full(/foo) gives same result as above.

Ok, Fine so far. But when nginx is added, a redirect to /index.html
should not go to /foo/index.html but to /index.html

So I tried:

 LiftRules.calculateContextPath = () = Full(/)

But now, hitting localhost:8080/foo/index.html (simulating a request
from nginx), I just get my raw index.html template without any Lift
processing as if Lift has ignored the request.

Am I misunderstanding the purpose of calculateContextPath?

How can I make lift run in a non-root context but at the same time,
when generating URLs, not prepend the context path?

/Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Context path, proxies Lift

2010-02-16 Thread Timothy Perrett
Contact me privatly with your IM adress and lets chat about it Jeppe -  
I'm doing something similar with helicon (windows proxy) and it's  
working fine.


I'm traveling now but will be about later

Cheers, Tim

Sent from my iPhone

On 16 Feb 2010, at 10:01, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:


Hi,

I want to setup a single nginx in front of two independent lift apps
(see previous thread) but haven't succeeded.
What I wan't is this:

External url foo.com/index.html goes to jetty: localhost:8080/foo/ 
index.html
External url bar.com/index.html goes to jetty: localhost:8080/bar/ 
index.html


So, I'm trying to see if I can get the basic jetty setup going before
throwing nginx in the mix.

Here are my findings:

With LiftRules.calculateContextPath = () = Empty:

Deploying lift app foo in context foo works fine: ie
localhost:8080/foo/index.html gives me the app and the app works with
the localhost:8080/foo prefix

Not surprisingly, setting  LiftRules.calculateContextPath = () =
Full(/foo) gives same result as above.

Ok, Fine so far. But when nginx is added, a redirect to /index.html
should not go to /foo/index.html but to /index.html

So I tried:

LiftRules.calculateContextPath = () = Full(/)

But now, hitting localhost:8080/foo/index.html (simulating a request
from nginx), I just get my raw index.html template without any Lift
processing as if Lift has ignored the request.

Am I misunderstanding the purpose of calculateContextPath?

How can I make lift run in a non-root context but at the same time,
when generating URLs, not prepend the context path?

/Jeppe

--
You received this message because you are subscribed to the Google  
Groups Lift group.

To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en 
.





--
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Context path, proxies Lift

2010-02-16 Thread Ross Mellgren
Any chance you could have this discussion on-list to increase the general 
knowledge about it?

-Ross

On Feb 16, 2010, at 8:50 AM, Timothy Perrett wrote:

 Contact me privatly with your IM adress and lets chat about it Jeppe - I'm 
 doing something similar with helicon (windows proxy) and it's working fine.
 
 I'm traveling now but will be about later
 
 Cheers, Tim
 
 Sent from my iPhone
 
 On 16 Feb 2010, at 10:01, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 
 Hi,
 
 I want to setup a single nginx in front of two independent lift apps
 (see previous thread) but haven't succeeded.
 What I wan't is this:
 
 External url foo.com/index.html goes to jetty: localhost:8080/foo/index.html
 External url bar.com/index.html goes to jetty: localhost:8080/bar/index.html
 
 So, I'm trying to see if I can get the basic jetty setup going before
 throwing nginx in the mix.
 
 Here are my findings:
 
 With LiftRules.calculateContextPath = () = Empty:
 
 Deploying lift app foo in context foo works fine: ie
 localhost:8080/foo/index.html gives me the app and the app works with
 the localhost:8080/foo prefix
 
 Not surprisingly, setting  LiftRules.calculateContextPath = () =
 Full(/foo) gives same result as above.
 
 Ok, Fine so far. But when nginx is added, a redirect to /index.html
 should not go to /foo/index.html but to /index.html
 
 So I tried:
 
 LiftRules.calculateContextPath = () = Full(/)
 
 But now, hitting localhost:8080/foo/index.html (simulating a request
 from nginx), I just get my raw index.html template without any Lift
 processing as if Lift has ignored the request.
 
 Am I misunderstanding the purpose of calculateContextPath?
 
 How can I make lift run in a non-root context but at the same time,
 when generating URLs, not prepend the context path?
 
 /Jeppe
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Context path, proxies Lift

2010-02-16 Thread Timothy Perrett
Seeing as I don't know what the solution is yet, no. Lol. I'd rather  
just have a 15 min conversation than waste time with a million emails  
( I'm very busy right now )


Will get jeppe to post working solution when one exists...

Cheers, Tim

Sent from my iPhone

On 16 Feb 2010, at 15:15, Ross Mellgren dri...@gmail.com wrote:

Any chance you could have this discussion on-list to increase the  
general knowledge about it?


-Ross

On Feb 16, 2010, at 8:50 AM, Timothy Perrett wrote:

Contact me privatly with your IM adress and lets chat about it  
Jeppe - I'm doing something similar with helicon (windows proxy)  
and it's working fine.


I'm traveling now but will be about later

Cheers, Tim

Sent from my iPhone

On 16 Feb 2010, at 10:01, Jeppe Nejsum Madsen je...@ingolfs.dk  
wrote:



Hi,

I want to setup a single nginx in front of two independent lift apps
(see previous thread) but haven't succeeded.
What I wan't is this:

External url foo.com/index.html goes to jetty: localhost:8080/foo/ 
index.html
External url bar.com/index.html goes to jetty: localhost:8080/bar/ 
index.html


So, I'm trying to see if I can get the basic jetty setup going  
before

throwing nginx in the mix.

Here are my findings:

With LiftRules.calculateContextPath = () = Empty:

Deploying lift app foo in context foo works fine: ie
localhost:8080/foo/index.html gives me the app and the app works  
with

the localhost:8080/foo prefix

Not surprisingly, setting  LiftRules.calculateContextPath = () =
Full(/foo) gives same result as above.

Ok, Fine so far. But when nginx is added, a redirect to / 
index.html

should not go to /foo/index.html but to /index.html

So I tried:

LiftRules.calculateContextPath = () = Full(/)

But now, hitting localhost:8080/foo/index.html (simulating a request
from nginx), I just get my raw index.html template without any Lift
processing as if Lift has ignored the request.

Am I misunderstanding the purpose of calculateContextPath?

How can I make lift run in a non-root context but at the same time,
when generating URLs, not prepend the context path?

/Jeppe

--
You received this message because you are subscribed to the Google  
Groups Lift group.

To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en 
.





--
You received this message because you are subscribed to the Google  
Groups Lift group.

To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en 
.




--
You received this message because you are subscribed to the Google  
Groups Lift group.

To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en 
.





--
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Context path, proxies Lift

2010-02-16 Thread Ross Mellgren
Okay, cool. Figured it couldn't hurt to ask ;-)

-Ross

On Feb 16, 2010, at 11:48 AM, Timothy Perrett wrote:

 Seeing as I don't know what the solution is yet, no. Lol. I'd rather just 
 have a 15 min conversation than waste time with a million emails ( I'm very 
 busy right now )
 
 Will get jeppe to post working solution when one exists...
 
 Cheers, Tim
 
 Sent from my iPhone
 
 On 16 Feb 2010, at 15:15, Ross Mellgren dri...@gmail.com wrote:
 
 Any chance you could have this discussion on-list to increase the general 
 knowledge about it?
 
 -Ross
 
 On Feb 16, 2010, at 8:50 AM, Timothy Perrett wrote:
 
 Contact me privatly with your IM adress and lets chat about it Jeppe - I'm 
 doing something similar with helicon (windows proxy) and it's working fine.
 
 I'm traveling now but will be about later
 
 Cheers, Tim
 
 Sent from my iPhone
 
 On 16 Feb 2010, at 10:01, Jeppe Nejsum Madsen je...@ingolfs.dk wrote:
 
 Hi,
 
 I want to setup a single nginx in front of two independent lift apps
 (see previous thread) but haven't succeeded.
 What I wan't is this:
 
 External url foo.com/index.html goes to jetty: 
 localhost:8080/foo/index.html
 External url bar.com/index.html goes to jetty: 
 localhost:8080/bar/index.html
 
 So, I'm trying to see if I can get the basic jetty setup going before
 throwing nginx in the mix.
 
 Here are my findings:
 
 With LiftRules.calculateContextPath = () = Empty:
 
 Deploying lift app foo in context foo works fine: ie
 localhost:8080/foo/index.html gives me the app and the app works with
 the localhost:8080/foo prefix
 
 Not surprisingly, setting  LiftRules.calculateContextPath = () =
 Full(/foo) gives same result as above.
 
 Ok, Fine so far. But when nginx is added, a redirect to /index.html
 should not go to /foo/index.html but to /index.html
 
 So I tried:
 
 LiftRules.calculateContextPath = () = Full(/)
 
 But now, hitting localhost:8080/foo/index.html (simulating a request
 from nginx), I just get my raw index.html template without any Lift
 processing as if Lift has ignored the request.
 
 Am I misunderstanding the purpose of calculateContextPath?
 
 How can I make lift run in a non-root context but at the same time,
 when generating URLs, not prepend the context path?
 
 /Jeppe
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to 
 liftweb+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/liftweb?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



[Lift] context path

2008-12-15 Thread Oliver

I have a few links within my pages where I don't want lift to prepend
the context path to the url. Is there any way to do this?

cheers
Oliver

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---