Search code examples
ruby-on-railsnginxcapistranounicorn

2 Rails Apps on Same Instance


I'm trying to deploy host a production instance for my rails 4 applications. I can currently (and successfully) host them using nginx, unicorn, and capistrano.

To save money I would like to host both of my rails 4 apps on the same instance. Is it possible to host multiple production environments, which would ideally be connected to different domains?

Thanks!


Solution

  • You can run multiple rails applications by configuring each application to use a different unicorn socket.

    You can then configure nginx sites (see /etc/nginx/sites-enabled/www.blah.com) to route to different unicorn sockets.

    Have a look at these answers: multiple rails apps on nginx and unicorn