Rails,Nginx,Puma:机架应用程序错误:RegexpError:上传大文件时无法分配内存

时间:2015-03-16 02:38:50

标签: ruby-on-rails nginx upload base64 puma

当我尝试上传25.5mb文件时收到错误Rack app error: #<RegexpError: failed to allocate memory: /\A[^%]*(?:%\h\h[^%]*)*\z/>。文件上传为base64编码数据。 Puma日志中会出现此错误。

nginx config:

upstream tgmu {
  server unix:///home/railsuser/eis/shared/tmp/sockets/puma.sock;
}

server {
  listen 80;
  client_max_body_size 100m;
  root /home/railsuser/eis/current/public;

  server_name xxx;

  location / {
    proxy_pass http://tgmu;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

如何解决这个问题?

0 个答案:

没有答案