带有 Nginx 的 Phusion Passenger 上的 Rails 不允许上传大小 > 2G 的文件。在上传过程中,我得到 500 错误和一个大小为 2G 的 /tmp 文件夹中的 RackMultipart 文件。
nginx.conf:
worker_processes 2;
timer_resolution 100ms;
worker_priority -5;
error_log /opt/vhod/webapp/shared/log/nginx_error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
passenger_root /home/vhod-admin/.rbenv/versions/1.8.7-p370/lib/ruby/gems/1.8/gems/passenger-3.0.19;
passenger_ruby /home/vhod-admin/.rbenv/versions/1.8.7-p370/bin/ruby;
passenger_max_pool_size 3;
passenger_pool_idle_time 1200;
passenger_spawn_method smart;
passenger_friendly_error_pages on;
passenger_log_level 1;
passenger_debug_log_file /opt/vhod/webapp/shared/log/passenger_debug.log;
include mime.types;
default_type application/octet-stream;
sendfile on;
client_max_body_size 0;
proxy_max_temp_file_size 0;
proxy_read_timeout 360s;
keepalive_timeout 70;
server {
listen 443;
server_name vhod;
charset utf-8;
root /opt/vhod/webapp/current/redmine/public;
passenger_enabled on;
passenger_use_global_queue on;
passenger_min_instances 1;
rails_env production;
ssl on;
ssl_certificate cert.pem;
ssl_certificate_key cert.key;
ssl_protocols SSLv3 TLSv1;
if (-f /opt/vhod/webapp/shared/system/maintenance.html) {
rewrite ^(.*)$ /opt/vhod/webapp/shared/system/maintenance.html last;
break;
}
}
}
一切都只有在没有 nginx 的情况下才能工作。当我使用应用程序运行 mongrel/thin/webrick 服务器时。所以,passenger是最新版本,3.0.19,nginx是1.2.6。怎么了?