Rails framework & Nginx web server

2019-08-04 06:56发布

问题:

As we install rails it uses its own web server WEBrick. If i want to run ths application in Nginx server, then how to configure or set the Nginx web werver?

回答1:

You should run your rails application in a production server such as mongrel_cluster or thin (I have used the former, and am currently switching to the latter). To put nginx in front of it, I would use the upstream and proxy_pass directives. I found a nice blog post comparing ways of running rails applications that shows their config for mongrel_cluster + nginx.

Passenger is also available for nginx, I've used that with Apache and it was very easy to set up.