Does using Passenger Standalone (powered by Nginx core) imply that we do not need the web facing HTTP servers like Apache or Nginx at all?
Does using Passenger Standalone (powered by Nginx core) imply that we do not need
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The short answer is “yes” that is indeed how it works. Basically passenger standalone allows you to run your application via
passenger start, and it uses nginx behind the scenes to actually serve rails requests.There is one big problem with running passenger standalone as your only webserver, however. If you want to run more than one ruby-based website, you’ll have to run them each on separate ports, since there’s no way to proxy requests to individual applications with passenger standalone by itself.
In my environment, I needed to run multiple sites using multiple different versions of ruby (not just different versions of rails). For example I have one site running Rails 2.3.x with Ruby Enterprise Edition, and another site running Rails 3.0.x running Ruby 1.9.2. I used passenger standalone with a separate Nginx proxy to solve this problem:
Each website runs passenger standalone, which I have configured to listen on a local UNIX socket. I use RVM to take care of loading my ruby version for me, so my
passenger startcommand is a bit lengthy, but it looks like this:cd /path/to/my/app; rvm use ree-1.8.7-2011.03@gemset; export GEM_HOME=/usr/local/rvm/gems/ree-1.8.7-2011.03@gemset; /usr/local/rvm/gems/ree-1.8.7-2011.03@gemset/bin/passenger start -d -S /tmp/mysite.com.sock -e production --pid-file /path/to/my/app/shared/pids/passenger.pidNow that my app is running and listening at
/tmp/mysite.com.sock, I have another Nginx instance that runs on port 80 that just uses simple proxy_pass rules to send requests to each site individually.Sorry for the long post, and maybe it’s a bit too much information… but I’ve found that this combo works really well, and I’ve written some nice
init.dstyle scripts to launch my individual passenger standalone apps. Nginx memory usage is so amazingly low that it doesn’t really cost anything to run 3 instances of it (1 for each site, and 1 on port 80).Hope this helps!