IIS 服务器:在请求中发布大数据时收到错误代码 413

kre*_*eya 2 php iis http-status-code-413

我在 IIS 上托管了用 laravel 编写的 WebAPI。我的一个请求大小为 60 MB。我试图将此数据发送到服务器,但收到 413 错误 - “请求实体太大”。

在此输入图像描述

我更新了 php.ini 并设置了以下值

  • 最大执行时间 = 6000
  • 上传最大文件大小 = 1512M
  • 最大输入变量 = 5000
  • post_max_size = 1024M

我还更新了IIS 服务器的uploadReadAheadSize并设置“80485760”

在此输入图像描述

编辑

更新 php.ini 和服务器配置后,我重新启动了服务器。

sam*_*mwu 6

您可以尝试以下设置:

<system.web>
  <httpRuntime maxRequestLength="1048576" />
</system.web>
<system.webServer>
  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="1073741824" /> 
    </requestFiltering>
  </security>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)