nginx+passenger部署ror
配置参数: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:
server { listen 80; server_name localhost; root /ror/public; # <--- be sure to point to 'public'! passenger_enabled on; rails_env development; #charset koi8-r; #access_log logs/host.access.log main; #error_page 404 /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_index index.php; # fastcgi_param SCRIPT_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 { # deny all; #}}server { listen 3080; server_name localhost; 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_name localhost; root /var/www/abc/public; # <--- be sure to point to 'public'! passenger_enabled on; charset utf-8; sendfile on; #access_log logs/host.access.log main; #error_page 404 /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_index index.php; # fastcgi_param SCRIPT_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 { # deny all; #} }