Http 发送大型Nginx POST导致对等方在30秒后重置连接
我正试图解决Ubuntu服务器20.4LTS上的nginx/1.18.0(Ubuntu)问题,该问题会在上传传输30秒后导致断开事件 该场景是通过发送大型HTTP POST请求(例如1GB)来测试HTTP协议中的上传吞吐量。 (这个任务不是我的主意,我只是被要求配置服务器) 我的步骤:Http 发送大型Nginx POST导致对等方在30秒后重置连接,http,ubuntu,nginx,curl,post,Http,Ubuntu,Nginx,Curl,Post,我正试图解决Ubuntu服务器20.4LTS上的nginx/1.18.0(Ubuntu)问题,该问题会在上传传输30秒后导致断开事件 该场景是通过发送大型HTTP POST请求(例如1GB)来测试HTTP协议中的上传吞吐量。 (这个任务不是我的主意,我只是被要求配置服务器) 我的步骤: 创建了一个1GB的文件(postest) 运行curl-X POST-d@postesthttp://IP_ADDR --最长时间900 作为响应,我收到:curl:(55)发送失败:对等方在30秒后重置连接 到
postest
)curl-X POST-d@postesthttp://IP_ADDR --最长时间900
curl:(55)发送失败:对等方在30秒后重置连接
urlib3.exceptions.ProtocolError:(“连接中止”,ConnectionResetError(104,“由对等方重置连接”)
error.log中没有错误,只有access.log中的HTTP 200
ubuntu@ip-xxxx:~$ cat /etc/nginx/sites-enabled/testsite
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /opt/http;
index index.html index.htm;
server_name _;
client_header_timeout 900s;
client_body_timeout 900s;
proxy_connect_timeout 900s;
proxy_read_timeout 900s;
proxy_send_timeout 900s;
location / {
try_files $uri $uri/ =404;
}
location /upload {
client_max_body_size 10000M;
try_files $uri $uri/ =404;
# To allow POST on static pages
error_page 405 =200 $uri;
}
}
谢谢你的帮助
ubuntu@ip-xxxx:~$ cat /etc/nginx/sites-enabled/testsite
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /opt/http;
index index.html index.htm;
server_name _;
client_header_timeout 900s;
client_body_timeout 900s;
proxy_connect_timeout 900s;
proxy_read_timeout 900s;
proxy_send_timeout 900s;
location / {
try_files $uri $uri/ =404;
}
location /upload {
client_max_body_size 10000M;
try_files $uri $uri/ =404;
# To allow POST on static pages
error_page 405 =200 $uri;
}