In many cases you allow your users to upload content through your application. In this article you'll see how to set the maximum upload size to the value that fits your needs.

In this example we'll increase the limit up to 20 MB (from the default 10 MB limit) for a site with domain site.com . But first, take a quick look to the basics about fine-tuning your applications with Moss if you haven't done it yet.

For the sake of simplicity, in the remainder of this article we provide examples for PHP 7.0. However everything stated here applies to all supported PHP versions. Just substitute 7.0 for the PHP version you're actually tweaking.

PHP-FPM configuration

  1. Log into your Ubuntu server as user moss: ssh moss@<server-ip> 
  2. Using sudo and your favorite text editor, create file /etc/php/7.0/fpm/conf.d/99-extra.ini (or a similar one) with the following content:
upload_max_filesize = 20M
post_max_size = 20M

Nginx configuration

  1. Log into your server as user moss: ssh moss@<server-ip> 
  2. Using sudo and your favorite text editor, add the following line to file /etc/openresty/server_params.<site-name>:
client_max_body_size 20m;

Provision your website

  1. Log into Moss
  2. Head to the details of site.com 
  3. Click the 'Provision' button and wait until Moss finishes the process
Did this answer your question?