Modify nginx upload file size configuration

王林
Release: 2020-07-17 17:50:24
forward
7050 people have browsed it

Modify nginx upload file size configuration

According to the official documentation, you can add configuration client_max_body_size size; in the http, server, location and other configuration blocks in the nginx configuration file to adjust the body size of the files allowed to be uploaded by the client. Set to 0, indicating no limit.

(Recommended tutorial: nginx usage tutorial)

nginx default client body size is 1M.

The specific configuration is as follows:

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;
	
    client_max_body_size 100m;
	....
	}
Copy after login

The above is the detailed content of Modify nginx upload file size configuration. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!