简体   繁体   English

HTTP 在Azure上部署应用程序时出现413错误

[英]HTTP 413 Error When App is Deployed on Azure

There is a strange problem that we have when we deploy our application on the Azure environment.当我们在 Azure 环境中部署我们的应用程序时,会遇到一个奇怪的问题。 When I start the application on my laptop, no Azure, no Docker or anything, on sending requests (which is a little bit big), I don't face any issues.当我在我的笔记本电脑上启动应用程序时,没有 Azure,没有 Docker 或任何发送请求(有点大),我没有遇到任何问题。

Our test and production environments are all on Azure right now.我们的测试和生产环境现在都在 Azure 上。 So when the application is deployed on it, I get this strange error:因此,当在其上部署应用程序时,出现了这个奇怪的错误:

log4javascript error: AjaxAppender.append: XMLHttpRequest request to URL ./common/logToServer.jsp?controllerName=6c3eaf3e-897d-4b30-a15e-62f9d3d3ce78 returned status code 413

Now I know what HTTP 413 error code is, but not sure, why my local is not showing the same error.现在我知道 HTTP 413 错误代码是什么,但不确定为什么我的本地没有显示相同的错误。 Which leads me to believe that it might be some Azure configuration that I need to change.这让我相信我可能需要更改一些 Azure 配置。 But don't know what.但不知道是什么。

It is simple web application on Java, Servlets and running on Tomcat.它是简单的 web 在 Java、Servlets 上的应用程序并在 Tomcat 上运行。

Log4j is used as a logging framework for JavaScript with no runtime dependencies. Log4j 用作 JavaScript 的日志记录框架,没有运行时依赖性。 As per the error statement, the issue was caused by the length of the payload, which is too large.根据错误说明,问题是由有效负载的长度过大引起的。

The HTTP status code 413 ("Payload Too Large") indicates that the request entity is larger than the limits defined by the server; HTTP状态码413(“Payload Too Large”)表示请求实体大于服务器定义的限制; the server might close the connection.服务器可能会关闭连接。

Fix: Under java code -> application.properties add these two lines修复:在 java 代码下 -> application.properties 添加这两行

server.tomcat.max-swallow-size=***MB //maximum size of the request body/payload
server.tomcat.max-http-post-size=*** MB //maximum size of entire POST request

NOTE: *** is your desired integer representing megabyte.注意:*** 是您想要的代表兆字节的 integer。

reference article for more information and solution.参考文章以获取更多信息和解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Function 应用程序 HTTP 触发函数在部署时不显示 - Azure Function App HTTP Trigger Functions don't show when deployed Azure 应用服务(Linux Nginx)文件上传错误413(Payload Too Large) - Azure App service (Linux Nginx) file upload error 413 (Payload Too Large) 部署在 azure web 应用程序上时找不到 React 应用程序上的字体 - Font on React app not found when deployed on azure web app 部署到 Azure Function App 时跨执行共享的字典值 - Dictionary values shared across executions when deployed to Azure Function App 为什么当尝试上传大视频时,App Engine gcloud 会抛出错误 413 entity too large? - why when try upload a large video, app engine gcloud throws error 413 entity too large? 将 csv 文件上传到 GCP 存储,413 http 代码错误 - Upload a csv file to GCP storage , 413 http code error Azure 应用程序服务中的 Nodejs 应用程序始终返回 HTTP 错误 404 - Nodejs app in Azure app service always returns HTTP ERROR 404 Elastic Beanstalk 在一个应用程序上给出错误 HTTP ERROR 503 而在另一个应用程序上却没有,而这两个应用程序的部署方式完全相同 - Elastic Beanstalk gives error HTTP ERROR 503 on one app and not the other while both are deployed in the same exact way 在 Asp.net web 应用程序部署在 azure 应用程序服务中,获取服务(.svc)端点的 404 未找到错误 - Getting 404 not found error for service(.svc) endpoints in Asp.net web application deployed on azure app service Asp.net 会员提供程序无法连接到内部部署 SQL 服务器部署到 Azure 应用程序服务 - Asp.net Membership provider fails to connect to on premise SQL Server when deployed to Azure app service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM