Nginx错误:客户端打算发送太大的正文 [英] Nginx error: client intended to send too large body

查看:40
本文介绍了Nginx错误:客户端打算发送太大的正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常遇到错误:

This site can't be reached.
The webpage at https://example.com/document might be temporarily down or it my have moved permanently to are new web address.

我的网站存储在AWS上.我使用rails + nginx + passenger.

My site is stored on AWS. I use rails + nginx + passenger.

Nginx错误日志:

Nginx error log:

client intended to send too large body: 3729822 bytes, 
client: 172.42.35.54, server: example.com, 
request: "POST /document HTTP/1.1", host: "test.example.com", 
referrer: "https://test.example.com/document/new"

应用日志:

ActionController :: RoutingError(没有路由与[GET]"/document"匹配)

一段时间后,错误消失.我怀疑这是由于部署造成的,但我不确定.您能告诉我,它与什么有关以及如何解决此问题吗?

After a while, the error disappears. I have doubts that this is due to deployment, but I'm not sure. Could you please tell me, with what it can be related and how to fix such a problem?

推荐答案

默认 Nginx配置将客户端请求正文限制为1Mb.
您必须增加 client_max_body_size 才能允许用户发布大型文档.
不要错过此说明的 context (http,服务器,位置),也不要忘记在此之后重新加载配置或重新启动Nginx.

Default Nginx config limits client request body with 1Mb.
You have to increase client_max_body_size to allow users to post large documents.
Don't miss with the context (http, server, location) of this derictive and don't forget to reload configuration or restart Nginx after that.

这篇关于Nginx错误:客户端打算发送太大的正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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