Modify the size limit of nginx uploaded files

Source: Internet
Author: User

A server that uses nginx as a proxy. I suddenly found that the client file uploaded for more than 1 MB could not be uploaded normally, so I modified the nginx configuration.

Cd/export/servers/nginx/conf/nginx. conf.

Location /{

Root html;

Index index.html index.htm;

Client_max_body_size 1000 m;

}

When the client_max_body_size field is added, it cannot be restarted. Later, the sub-configuration file was found in the total 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;

The sub-configuration file is found and modified in the sub-configuration file. The configuration file is 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 1000 m;

}

}

Restart with/export/servers/nginx/sbin/nginx-s reload to solve the problem of limited file size.

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.