In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to solve the problem of Nginx upload large file timeout, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
The solution to the timeout of uploading large files on Nginx
The situation is as follows: using nginx as a proxy server, when uploading large files (I tested uploading 50m files), it is suggested that the upload timed out or the file was too large.
The reason is that nginx has a limit on the size of uploaded files, and the default is 1m. In addition, if the uploaded file is very large, the upload timeout should be adjusted appropriately.
The solution is to add the following configuration under the configuration file of nginx:
Client_max_body_size 50m; / / File size limit. Default 1mclient_header_timeout 1m; client_body_timeout 1m; proxy_connect_timeout 60s; proxy_read_timeout 1m; proxy_send_timeout 1m
The meaning of each parameter:
Client_max_body_size
Limit the size of the request body, if it exceeds the set size, a 413 error is returned.
Client_header_timeout
If the timeout for reading the request header exceeds the set size, a 408 error is returned.
Client_body_timeout
If the timeout for reading the request entity exceeds the set size, a 413 error is returned.
Proxy_connect_timeout
The http request cannot be processed immediately by the container (tomcat, netty, etc.) and is placed in the pending pool of nginx waiting to be processed. This parameter is the maximum waiting time. The default is 60 seconds. It is officially recommended that the maximum waiting time is no more than 75 seconds.
Proxy_read_timeout
After the http request is processed by the container (tomcat, netty, etc.), the nginx waits for the processing result, that is, the response returned by the container. This parameter is the server response time, which defaults to 60 seconds.
Proxy_send_timeout
After the http request is processed by the server, it takes 60 seconds by default to send the data back to Nginx.
Thank you for reading this article carefully. I hope the article "how to solve the problem of timeout of uploading large files on Nginx" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.