0

I want to build a rails app that will host multiple domains(sites). Some content will be similar across all the sites which is why I want it in the one database/app. I thought that I could use a different controller for each domain/site with each action relating to a single page ( each site will only have 4-5 pages ).

This seems possible given the answer here, however I'd like to know what effects this would have on caching, using nginx as the server ( As it's mostly static content I'd like to use page caching ) i.e wouldn't the app need to hit at every request to process the right page/domain?

Community
  • 1
  • 1
raphael_turtle
  • 7,154
  • 10
  • 55
  • 89

1 Answers1

0

I dont think thats a good solution. You should setup the application n times and handel the domains/subdomains using nginx and the upstream module.

Using one single instance of an application for various domains seems to be a loose solution to me. I would avoid that unless the content of the sites does depend on another directly. And even in that case I think an API is the better solution.

davidb
  • 8,884
  • 4
  • 36
  • 72