Nginx Modify upload File size limit

Source: Internet
Author: User

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:

< Span style= "FONT-SIZE:14PX;" >sendfile        on;
    #tcp_nopush     on;
            
    #keepalive_timeout  0;
    Keepalive_timeout  65;
              
    #gzip  on;
    include domains/*;
   



Then found the sub-configuration file, in the allocation file inside to modify. The sub-configuration file is configured as follows:


< Span style= "FONT-SIZE:14PX;" >server
        {
           listen   +
           server_name  chat.erp.360buy.com;
#          access_log    /export/servers/nginx/logs/chat.erp.360buy.com;
           location/{
           proxy_pass   &N Bsp Http://tomcat;
                 client_max_body_size    1000m;
             }
       }
        with/export/servers/nginx/sbin/nginx-s reload reboot, the size of the uploaded file is limited and the issue is resolved.
        Share my resolution, I hope it will be helpful to everyone.




Ubuntu Nginx Path:

Configuration file:/etc/nginx/conf.d

Script file:/usr/sbin/nginx

Nginx Modify upload File size limit

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.