sub domain + different rails application

49 views
Skip to first unread message

saravanan p

unread,
Dec 17, 2013, 1:15:05 AM12/17/13
to rubyonra...@googlegroups.com
Hello friends,

Is there any way to implement the subdomain i.e two more rails application, but main domain is same. 
Ex: 

Note: its not a single rails application.
I am using rails 4, ruby 2.0

Please guide me.

Karthik Sirasanagandla

unread,
Dec 17, 2013, 3:05:21 AM12/17/13
to rubyonra...@googlegroups.com
Use a webserver like nginx to route traffic to different rails application.

Sample config in nginx can be as below:
server {
  # Subdomain
  listen 80;
  server_name subdomain1.domain.com;
  location / {
    proxy_pass http://127.0.0.1:8000/;
  }
}
server {
  # Subdomain
  listen 80;
  server_name subdomain2.domain.com;
  location / {
    proxy_pass http://127.0.0.1:8888/;
  }
}

Cheers and good luck!
Karthik

ThoWac

unread,
Dec 17, 2013, 3:36:01 AM12/17/13
to rubyonra...@googlegroups.com
Hi,

if you use Apache Webserver and PhusionPassenger you can take a look her:

Norm Scherer

unread,
Dec 17, 2013, 11:20:09 AM12/17/13
to rubyonra...@googlegroups.com
I use multiple virtual hosts with apache2 and phusion passenger for that
problem. Works fine.

Norm
> --
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/7b1a36ff-f75f-461f-9bff-14e3edb78edd%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

saravanan p

unread,
Dec 18, 2013, 5:18:03 AM12/18/13
to rubyonra...@googlegroups.com
Thank you!

Let me check with apache2 and puhsion passenger. Thanks again!


On Tue, Dec 17, 2013 at 9:50 PM, Norm Scherer <norms...@earthlink.net> wrote:
I use multiple virtual hosts with apache2 and phusion passenger for that problem.  Works fine.

Norm


On 12/16/2013 11:15 PM, saravanan p wrote:
Hello friends,

Is there any way to implement the subdomain i.e two more rails application, but main domain is same.
Ex:
rails1.mainsite.com
rails2.mainsite.com
rails3.mainsite.com
rails4.mainsite.com

Note: its not a single rails application.
I am using rails 4, ruby 2.0

Please guide me.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/52B079B9.1040205%40earthlink.net.
Reply all
Reply to author
Forward
0 new messages