Automatic sub domain creation

54 views
Skip to first unread message

John Clegg

unread,
May 29, 2012, 7:00:02 PM5/29/12
to WellRailed
Hi Everyone,

I just wanted to check how people are doing automatic sub-domain assignment these days. 

eg. I have an app that has creates a new sub domain when some one signs up. eg. mysite.blahhq.com and the next guy signups and creates fubar.blahhq.com and this gets forward to the write part of the application.

My googling has told me that I can do some clever apache / nginx rules to do this. I'm trying to figure out how to do it automagically with no manual intervention.

Any advice is much appreciated.

Cheers

John

--
John Clegg


James Harton

unread,
May 29, 2012, 7:03:13 PM5/29/12
to wellr...@googlegroups.com, WellRailed
Hi John.

This is covered in the "Rails routing from the outside in" Rails Guide:  http://guides.rubyonrails.org/routing.html#request-based-constraints

James Stradling

unread,
May 29, 2012, 7:26:21 PM5/29/12
to wellr...@googlegroups.com, WellRailed
Hi John,

One basic strategy is to create wildcard subdomain, e.g. *.blahhq.com, serve your app on *.blahhq.com and use the subdomain component of the URL to serve the correct content to the visitor.


James


On Wednesday, May 30, 2012 11:00:02 AM UTC+12, John Clegg wrote:

Wei Feng

unread,
May 29, 2012, 7:18:30 PM5/29/12
to wellr...@googlegroups.com
also a railscasts on that
http://railscasts.com/episodes/221-subdomains-in-rails-3?view=asciicast
> --
> You received this message because you are subscribed to the Google Groups
> "WellRailed" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/wellrailed/-/VB-uxTFglaQJ.
>
> To post to this group, send email to wellr...@googlegroups.com.
> To unsubscribe from this group, send email to
> wellrailed+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/wellrailed?hl=en.



--
Regards,
Wei Feng

03 9005 3441 | M 0413 658 250 | win...@gmail.com | http://wei.feng.id.au
Reply all
Reply to author
Forward
0 new messages