Nginx configuration upload file size limit

Previously developing Nginx based on Flask web as a reverse proxy required users to upload larger files to the server for calculation. Initially, there was no problem with uploading files with a small amount of data. Once the files were slightly larger, they could not be uploaded and an error would be reported directly. The reason is very simple, it is the problem of nginx configuration, just add a client_max_body_size configuration in the configuration.
The specific operations are as follows:

  1. First find the configuration file nginx.conf
root@ubuntu:/etc# locate nginx.conf
/etc/nginx/nginx.conf
  1. Edit configuration file
root@ubuntu:/etc# vim /etc/nginx/nginx.conf

Add in http:

client_max_body_size 100m;

100 of them can be modified according to actual development needs

Insert picture description here
3. After modifying the configuration, you need to restart nginx to take effect, and enter the sbin file.

cd /usr/sbin
./nginx -s reload

Guess you like

Origin blog.csdn.net/Lin_Hv/article/details/105393832