- Home
- Uncategorized
- Enable NGINX to Allow Larger Uploads
Enable NGINX to Allow Larger Uploads
Many times we’ll set up a new media server and will need to allow larger files to be uploaded. This is also useful when running a WordPress site with NGINX
sudo nano /etc/nginx/nginx.conf
Look for a setting called client_max_body_size and update it to a marge larger number, I like 8000M. If there is no client_max_body_size setting, add the following line:
client_max_body_size 8000M;
Update PHP Settings For Larger Uploads
We’ll often also need to increase the PHP limits. Edit your php.ini file. If you don’t know the location of your php settings file, use the PHP function phpinfo() to show all of the configurations settings, including the location of php.ini (this is important because you may have various versions of PHP on your system and you don’t know which one is being used)
sudo nano /etc/php/7.1/fpm/php-fpm.conf
Look for the upload_max_filesize and post_max_size settings and increase the values to an acceptable level
upload_max_filesize = 8000M post_max_size = 8000M