Nginx Modify the Upload file size limit method _nginx

Source: Internet
Author: User

New installed a server, with Nginx do agent. Suddenly found that upload more than 1M large client files can not be uploaded correctly, and then modified the configuration of the next nginx.

Cd/export/servers/nginx/conf/nginx.conf, in 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 is not possible. Later, a profile was found in the general configuration file:

Sendfile on    ;
#tcp_nopush on   ;
 
#keepalive_timeout 0;
Keepalive_timeout;
  
#gzip on;
Include domains/*; ######################## #分配置文件路径在此
#include domains/chat.local;
#include domains/chat.erp.com;
#include domains/support.chat.com;
#include douains/chat.com;

server {
 listen    ; 
server_name localhost;   The Include domains/* command specifies the path to the split configuration file. After you find the profile, modify it in the allocation file. The profile configuration file is configured as follows:


server
{
 listen  ;
 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 reboot, the problem of the size of the uploaded file is solved.

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.