欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

使用Passenger+nginx部署Rails

程序员文章站 2022-03-14 18:40:39
...
1. Install Passender
gem install passenger


2. Install nginx
passenger-install-nginx-module
1. Yes: download, compile and install Nginx for me. (recommended)
Please specify a prefix directory [/opt/nginx]: /opt/nginx


3. Deploy Rails app
vi /opt/nginx/conf/nginx.conf
server {
        listen       80;
        server_name  localhost;
        root /xx/xx/rails_app/public;
        passenger_enabled on;
        rails_env production;
}


4. Start/Stop nginx
/opt/nginx/sbin/nginx
/opt/nginx/sbin/nginx -s quit
相关标签: nginx Rails