Sometimes it is necessary to upload some large files. The old High server is nginx + php, both of which need to be configured.
Nginx
At the beginning, the old master only configured PHP and always reported an error every time a large file was transferred.
413 "Request Entity Too Large"
The reason is that nginx limits the size of the uploaded files on the client. The modification method is very simple. Just modify client_max_body_size to the required value!
# Search for client_max_body_size. If there are few configuration files, you do not need to search. Open the server segment of the configuration file directly.
Grep-nr client_max_body_size.
# Change to 200 M
Client_max_body_size 200 M;
# Save and restart nginx
Nginx-s reload
PHP
PHP needs to be modified in many places, mainly post_max_size and upload_max_filesize, as well as script execution time. We recommend that you modify it in the code at runtime, the method is set_time_limit (600); and there is also memory_limit to be modified, but there is no error at present!
RUN sed's/post_max_size = 8 M/post_max_size = 20000 M/'-I/usr/local/etc/php. ini \
& Sed's/upload_max_filesize = 2 M/upload_max_filesize = 20000 M/'-I/usr/local/etc/php. ini \
& Sed's/^; \ s * max_input_vars = 1000/max_input_vars = 10000/'-I/usr/local/etc/php. ini