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
On Tuesday, 17 December 2013 11:45:05 UTC+5:30, 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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/b665c034-222f-4d8a-8462-6c83fd06dc26%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.