Heroku Nginx HTTP 413实体太大了

Chr*_*sco 8 nginx heroku laravel-5

上传4MB文件时收到错误413.我已经在.user.ini文件public/夹上创建了一个文件.允许最多10 MB的文件

所以我client_max_body_size在我身上使用了这个nginx.conf,但我仍然得到了413.

location / {
    index index.php;
    try_files $uri $uri/ /index.php?$query_string;
    client_max_body_size 10M;
}
Run Code Online (Sandbox Code Playgroud)

那个配置是​​因为我正在使用Laravel 5.

这是我的 Procfile

web: vendor/bin/heroku-php-nginx -C nginx.conf public/
Run Code Online (Sandbox Code Playgroud)

我做错什么了吗?

Dev*_*ith 5

也许有点晚了,但是为了解决这个问题,请将您移出client_max_body_size 10M;位置部分。像这样:

client_max_body_size 10M;

location / {
    index index.php;
    try_files $uri $uri/ /index.php?$query_string;
}
Run Code Online (Sandbox Code Playgroud)

有关heroku如何包含此文件的参考,请参见https://github.com/heroku/heroku-buildpack-php/blob/beta/conf/nginx/heroku.conf.php#L35