添加“后的状态代码502”;客户“U最大”车身“U尺寸”;Nginx指令
我需要提高上传文件的门槛。在我的情况下,10MB就可以了 因此,我将该指令添加到我的nginx配置文件中:添加“后的状态代码502”;客户“U最大”车身“U尺寸”;Nginx指令,nginx,flask,Nginx,Flask,我需要提高上传文件的门槛。在我的情况下,10MB就可以了 因此,我将该指令添加到我的nginx配置文件中: server { listen 80; client_max_body_size 10M; keepalive_timeout 120000; location / { proxy_pass http://users:5000; proxy_redirect default; proxy_set_header Host $ho
server {
listen 80;
client_max_body_size 10M;
keepalive_timeout 120000;
location / {
proxy_pass http://users:5000;
proxy_redirect default;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
client_max_body_size 10M;
client_body_buffer_size 1000M;
}
}
以及Flask后端上的配置:
class BaseConfig:
...
MAX_CONTENT_LENGTH = 10 * 1024 * 1024
更新后,我收到状态代码502。如果没有client\u max\u body\u size
指令,我将获得状态代码413
我sh
插入nginx服务器并运行nginx-s reload
,因为新配置需要重新启动才能生效。不过还是得到了502分
nginx日志显示:
[error] 26#26: *3 writev() failed (104: Connection reset by peer) while sending request to upstream server
Active connections: 1
server accepts handled requests
14 14 13
Reading: 0 Writing: 1 Waiting: 0
更新:
stub\u状态
显示模块:
[error] 26#26: *3 writev() failed (104: Connection reset by peer) while sending request to upstream server
Active connections: 1
server accepts handled requests
14 14 13
Reading: 0 Writing: 1 Waiting: 0
然而,这并不是很有帮助,因为它并没有指明发生了什么
错
我还需要检查什么?您在更改之前和之后是否尝试过监视网络连接?@MacOS问题是,我在前端使用非浏览器gui,所以我不能只点击F12,然后转到“网络”选项卡。有没有其他方法可以查看网络层发生了什么?@MacOS我刚刚了解了stub_状态模块。在我的问题中添加了stub_状态输出。