加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

Heroku Nginx HTTP 413实体太大了

发布时间:2020-12-13 21:00:07 所属栏目:Nginx 来源:网络整理
导读:上传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; c

上传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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读