Ruby on rails Nginx错误:客户端打算发送太大的正文

Ruby on rails Nginx错误:客户端打算发送太大的正文,ruby-on-rails,ruby,amazon-web-services,nginx,amazon-ec2,Ruby On Rails,Ruby,Amazon Web Services,Nginx,Amazon Ec2,我会定期收到一个错误: 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+乘客 Nginx错误日志: client intended to send too large body: 3

我会定期收到一个错误:

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+乘客

Nginx错误日志:

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]匹配的路由)

过了一会儿,错误消失了。我怀疑这是由于部署,但我不确定。您能告诉我它与什么相关以及如何解决这样的问题吗?

Nginx config将客户端请求正文限制为1Mb。
您必须增加
客户端\u最大\u正文\u大小
以允许用户发布大型文档。

不要错过此派生的上下文(http、服务器、位置),也不要忘记重新加载配置或重新启动Nginx。

对于我来说,
Nginx.conf
的路径是
/etc/Nginx/Nginx.conf

在我的例子中,我刚刚在
http块
中添加了
client\u max\u body\u size
,它对我起了作用

http {
    ...
    client_max_body_size 20M;
}    
更改此配置后,请确保
重新启动nginx