A long time ago, I needed to make a server run PHP with CakePHP / Laravel and Ruby with Rails, at the same time. I’m usually using Debian and NGINX on every server I configure, and then it came that challenge of configuring the rewrite for running a project on a subfolder.

The configuration is a little bit different of what I’m used to do for PHP projects, because for Rails, I’ve used Unicorn behind NGINX, through socket. NGINX configuration is like this:

At Unicorn configuration file, we do the following:

All set… Start Unicorn as a daemon (unicorn_rails -c config/unicorn.rb -D) and reload NGINX (sudo /etc/init.d/nginx reload).

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.