上传4MB文件时收到错误413.我已经在public /文件夹上创建了一个.user.ini文件.允许最多10 MB的文件
所以我在我的nginx.conf上使用了client_max_body_size,但我仍然得到413.
location / {
index index.php;
try_files $uri $uri/ /index.php?$query_string;
client_max_body_size 10M;
}
那个配置是因为我使用的是Laravel 5.
这是我的Procfile
web: vendor/bin/heroku-php-nginx -C nginx.conf public/
我做错什么了吗?
最佳答案
也许有点晚了,但为了解决这个问题,请移动你的client_max_body_size 10M;在位置部分之外.像这样:
client_max_body_size 10M;
location / {
index index.php;
try_files $uri $uri/ /index.php?$query_string;
}
有关heroku如何包含此文件的参考,请参阅https://github.com/heroku/heroku-buildpack-php/blob/beta/conf/nginx/heroku.conf.php#L35.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。