And*_*ndy 14 ruby ruby-on-rails nginx amazon-ec2 amazon-web-services
我定期收到一个错误:
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.
Run Code Online (Sandbox Code Playgroud)
我的网站存储在 AWS 上。我使用导轨 + 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"
Run Code Online (Sandbox Code Playgroud)
应用日志:
ActionController::RoutingError (No route matches [GET] "/document")
一段时间后,错误消失。我怀疑这是由于部署造成的,但我不确定。你能告诉我它与什么有关以及如何解决这样的问题吗?
Zoh*_*Ali 18
对我来说nginx.conf是/etc/nginx/nginx.conf.
就我而言,我只是添加client_max_body_size了http block它,它对我有用
http {
...
client_max_body_size 20M;
}
Run Code Online (Sandbox Code Playgroud)
确保restart nginx在更改此配置后
我已经更新了/etc/nginx/nginx.conf
就我而言,我在后面添加client_max_body_size了http block如下sendfile on;内容
http {
...
sendfile on;
client_max_body_size 20M;
}
Run Code Online (Sandbox Code Playgroud)
client_max_body_size放在后面非常重要sendfile on;
更新 nginx.conf 后不要忘记重新启动 nginx,如下所示
对于Ubuntu
sudo service nginx restart
Run Code Online (Sandbox Code Playgroud)
对于 Centos
sudo systemctl restart nginx
Run Code Online (Sandbox Code Playgroud)
server在子句中添加以下 3 个命令nginx.conf
sendfile on;
client_max_body_size 20M;
client_body_buffer_size 20M;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13808 次 |
| 最近记录: |