Installed a server, with Nginx agent. Suddenly found that uploading more than 1M large client files do not upload properly, so modified the configuration of the Nginx.
CD /export/servers/nginx/conf/nginx.conf, inside the server section of this configuration file
Location/{
root HTML;
Index index.html index.htm;
Client_max_body_size 1000m; #没有的可自行加上
}
Add the Client_max_body_size field, how to restart it is not possible. A sub-configuration file was later found in the general configuration file:
Sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
Keepalive_timeout 65;
#gzip on;
Include domains/*;
#include domains/chat.local;
#include domains/chat.erp.com;
#include domains/support.chat.com;
#include douains/chat.com;
server {
Listen 80;
server_name localhost;
Then found the sub-configuration file, in the allocation file inside to modify. The sub-configuration file is configured as follows:
Server
{
Listen 80;
server_name chat.erp.360buy.com;
# access_log/export/servers/nginx/logs/chat.erp.360buy.com;
Location/{
Proxy_pass Http://tomcat;
Client_max_body_size 1000m;
}
}
With/export/servers/nginx/sbin/nginx-s reload restart, the upload file size is limited to solve the problem.
Share my solution, I hope it will be helpful to everyone.
Nginx Modify upload File size limit