node.js - Azure 应用服务 IIS "maxRequestLength"设置

标签 node.js azure iis

我在 Azure 应用服务上部署了一个 NodeJS 应用程序。 使用 38 MB 的文件进行发布时,我收到 404 错误,但实际上存在 IIS 问题 “在 Web 服务器上配置请求过滤以拒绝请求,因为内容长度超过配置值。”

要设置“ma​​xAllowedContentLength”,我必须编辑“web.config”文件。

这不好,因为如果我对 Azure 门户应用程序设置进行一些更改,我的本地版本的 web.config' 就会与自动生成的文件发生冲突。

是否可以以不同的方式设置“ma​​xAllowedContentLength”?

最佳答案

"Request filtering is configured on the Web server to deny the request because the content length exceeds the configured value."

据我所知,maxAllowedContentLength的默认值为30000000(大约28.6MB)。我们可以 connecting to a Windows Azure Website from IIS Manager with remote administration ,然后我们就可以找到请求限制,如下所示。

enter image description here

因此,当您发布大约 38MB 数据时,请求将失败。在我这边,我增加了 web.config 中 maxAllowedContentLength 的值,我可以从我的 Web API 发布大于 28.6MB 的数据。

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="<valueInBytes>"/>
  </requestFiltering>
</security>

对我的 Web API 的请求:

enter image description here

您可以在本地 web.config 中配置/修改 maxAllowedContentLength 属性,并使用 web.config 将应用程序部署到您的 Azure 网站。如果您遇到任何冲突错误,请与我们分享错误详细信息。

关于node.js - Azure 应用服务 IIS "maxRequestLength"设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43186826/

相关文章:

asp.net - 在 w3wp 进程之间共享程序集以减少内存使用

node.js - npm install 给出错误 "can' t find a package.json file"

javascript - 如何编写nodejs服务,一直运行

wpf - Azure StorageClient 客户端超时

azure - 是否可以将大量 JSON 数据发送到 IoT 中心?

.net - System.Runtime.InteropServices.COMException (0x800A03EC)

asp.net-mvc - 使用 .net mvc 在 IIS angular 2 应用程序上发布

node.js - Sails Js - 同时访问多个 Controller

c - Node-ffi 调用 c DLL 返回指针

linux - 在linux vm中删除数据磁盘在windows azure中返回错误