Azure应用服务IIS"maxRequestLength"环境 [英] Azure App Service IIS "maxRequestLength" setting

查看:70
本文介绍了Azure应用服务IIS"maxRequestLength"环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azure App Service上部署了NodeJS应用程序.使用38 MB的文件进行发布时,我收到404错误,但是在后台却出现了IIS问题由于内容长度超出了配置的值,因此在Web服务器上将请求过滤配置为拒绝请求."

要设置" maxAllowedContentLength ",我必须编辑" web.config "文件.

这不是很好,因为如果我在Azure Portal应用程序设置上进行了一些更改,则我的本地版本 web.config '与自动生成的文件会发生冲突.

是否可以以其他方式在" maxAllowedContentLength "上进行设置?

解决方案

由于内容长度超过配置的值,因此在Web服务器上将请求过滤配置为拒绝请求."

据我所知,maxAllowedContentLength的默认值为30000000(大约28.6MB).我们可以

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

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

对我的Web API的请求:

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

I have a NodeJS application deployed on a Azure App Service. Doing a post with a file of 38 MB I obtain a 404 error but under the hood there is a IIS problem "Request filtering is configured on the Web server to deny the request because the content length exceeds the configured value."

To set 'maxAllowedContentLength' I have to edit 'web.config' file.

This is not good because if I do some change on the Azure Portal App Settings my local version of web.config' goes in conflict with the auto-generated file.

Is it possible to set on 'maxAllowedContentLength' in a different way ?

解决方案

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

As far as I know, the default value of maxAllowedContentLength is 30000000 (approximately 28.6MB). We could connecting to a Windows Azure Website from IIS Manager with remote administration, and then we could find the request limits, like this.

So the request will fail when you post about 38MB data. On my side, I increase the value of maxAllowedContentLength in web.config, I could post the data that is larger than 28.6MB from my Web API.

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

Request to my Web API:

You could configure/modify maxAllowedContentLength property in your local web.config and deploy your app with web.config to your Azure Website. If you get any conflict error, please share us the error details.

这篇关于Azure应用服务IIS"maxRequestLength"环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆