In PHP I could have single php-fpm instance to serve multiple sites. The nginx config I had was looking like so:
upstream backend
{
server 127.0.0.1:9000;
}
# site 1
server
{
server_name www.site1.com;
root /var/www/site1;
location ~ \.php$
{
include fastcgi_params;
fastcgi_pass backend;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
# site 2
server
{
server_name www.site2.com;
root /var/www/site2;
location ~ \.php$
{
include fastcgi_params;
fastcgi_pass backend; # still the same backend
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
What I see in Ruby world is that for each application a separate independent server is started which listens on a specific port and can can handle requests only to this application. So I'm wondering, is it possible to have the same approach with Ruby applications as I could have with PHP above.
I understand that this could be not very good idea for high-traffic sites, but I'm actually dealing with quite low-traffic sites and my VPS has limited RAM.