sdxh0506 发表于 2016-12-23 10:48:52

nginx+passenger部署ror

本文为firedragonpzy原创,转载务必在明显处注明:
转载自【Softeware MyZone】原文链接: http://www.firedragonpzy.com.cn/index.php/archives/449
配置参数:http://blog.lizhigang.net/archives/137
./configure --prefix=/usr/local/nginx --with-http_ssl_module--with-pcre=/usr/local/soft/pcre-8.30 --with-openssl=/usr/local /soft/openssl-1.0.1 --add-module=/usr/soft/passenger-3.0.11
1.安装passenger:
gem install passenger
2.安装nginx
passenger-install-nginx-module#(期间一路回车即可,【pcre最好安装,不装也可】)
#----ps -ef | grep nginx | wc -l 查看nginx并发进程数
3.配置nginx:
server {
listen       80;
server_namelocalhost;
root /ror/public;   # <--- be sure to point to 'public'!   
passenger_enabled on;
rails_env development;
#charset koi8-r;
#access_loglogs/host.access.logmain;

#error_page404            /404.html;
# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504/50x.html;
location = /50x.html {
root   html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#    proxy_pass   http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
#    root         html;
#    fastcgi_pass   127.0.0.1:9000;
#    fastcgi_indexindex.php;
#    fastcgi_paramSCRIPT_FILENAME/scripts$fastcgi_script_name;
#    include      fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#    denyall;
#}
}
server {
listen       3080;
server_namelocalhost;
root /var/www/abc/public;   # <--- be sure to point to 'public'!   
passenger_enabled on;
charset utf-8;
sendfile on;
error_page   500 502 503 504/50x.html;
location = /50x.html {
root   html;
}
}
upstream backserver{
server 127.0.0.1:3080;
}
server {
listen       80;
server_namelocalhost;
root /var/www/abc/public;   # <--- be sure to point to 'public'!   
passenger_enabled on;
charset utf-8;
sendfile on;
#access_loglogs/host.access.logmain;

#error_page404            /404.html;
# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504/50x.html;
location = /50x.html {
root   html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#    proxy_pass   http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
#    root         html;
#    fastcgi_pass   127.0.0.1:9000;
#    fastcgi_indexindex.php;
#    fastcgi_paramSCRIPT_FILENAME/scripts$fastcgi_script_name;
#    include      fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#    denyall;
#}
}
页: [1]
查看完整版本: nginx+passenger部署ror