Multiple Domain names on one liftweb App

66 views
Skip to first unread message

DoomPirate

unread,
Mar 31, 2015, 8:57:27 PM3/31/15
to lif...@googlegroups.com
Hi,

I apologize if this question is too similar to the last question I asked. It's kind of different.

Can one liftweb app be the framework for multiple lift "websites"? 

I have a bunch of small, low traffic websites that I need to create.

Is it possible to bind the domain name so it isn't on the root of the liftweb app? That way, I could have one liftweb app be the host for multiple "websites"


I will define 2 example websites
So with this code

          Menu.i(main) / "index", 
          Menu.i("Bar") / "bar",
          Menu.i("Foo") / "foo",
  Menu.i("Bar - About Us"l) / "bar" / "about-us",
  Menu.i("Bar - Page 1") / "bar" / "page1",
  Menu.i("Foo - About Us") / "foo" / "about-us",
          Menu.i("Foo - Page 2") / "foo" / "page2",

bar.com has 3 pages

foo.com has 3 pages


If this isn't possible, are there any other alternatives for me to efficiently host a bunch of small/low traffic websites?(And not impact input latency for the websites a great amount) I would love to be able to host 20+ small websites on an EC2 microinstance.


Any thoughts or advice will be greatly appreciated.

Thanks

DoomPirate

unread,
Mar 31, 2015, 9:01:24 PM3/31/15
to lif...@googlegroups.com
And I am aware of having multiple war/jetty pairs on an instance.

Antonio Salazar Cardozo

unread,
Apr 6, 2015, 11:37:17 AM4/6/15
to lif...@googlegroups.com
Tbh, I'd do this with nginx or some other reverse proxy. You can do a quick URI rewrite there
and prefix requests to bar.com with /bar, and requests to foo.com with /foo. It's the most straight-
forward way, IMO.
Thanks,
Antonio

Philip Nguyen

unread,
Apr 6, 2015, 11:48:03 AM4/6/15
to lif...@googlegroups.com

Thanks. I have learned about nginx url rewrites and I have been attempting to use them. It's a little hard for me to grasp, I wish there were more plain english guides. If you or anyone can help me with example server/rewrite/location configuration pseudocode for my example, I would be extremely grateful. I should be able to figure it out, but it will be a little struggle.
Thanks!

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to a topic in the Google Groups "Lift" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/liftweb/xDLW7QhDcbI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

DoomPirate

unread,
Apr 11, 2015, 4:56:18 PM4/11/15
to lif...@googlegroups.com
I got it working, this configuration worked

server {
        listen 80 default_server;
        root /usr/share/nginx/html;
        index index.html index.htm;
        server_name foo.com localhost;

 location / {
        proxy_pass http://127.0.0.1:8080/foo/;
    }
}



server {
        listen 80;
        root /usr/share/nginx/html;
        index index.html index.htm;
        server_name bar.com localhost;

         location / {
        proxy_pass http://127.0.0.1:8080/bar/;
    }

}

Took me 14 hours of struggling to finally get it, haha.


On Tuesday, March 31, 2015 at 9:01:24 PM UTC-4, DoomPirate wrote:

Antonio Salazar Cardozo

unread,
Apr 19, 2015, 4:38:02 PM4/19/15
to lif...@googlegroups.com
Sorry, this ended up happening during a nasty span when I didn't have much time to
help on the list. Wish I could have saved you some of those hours, but glad you figured
it out!
Thanks,
Antonio
Reply all
Reply to author
Forward
0 new messages