Change form uploader max size

Modified on Thu, 11 Jul at 10:44 AM

Problem

By default, the maximum size of a file in a form uploader is 500Mb.

If you try to upload a bigger file the system raise an error:


Solution

Edit the file ngnix.conf.


With classic RedHat setup:

http 

/etc/nginx/sites-available/embrace-app-http-3.0.conf

https

/etc/nginx/sites-available/embrace-app-https-3.0.conf


With Docker compose setup:

http

<installer>/conf/embrace-app.conf.template

https

<installer>/conf/embrace-app-ssl.conf.template

Warning

On a Docker installation, you must mount the file on the container from compose-local.yml.

http

services:
  nginx:
    volumes:
    - ./conf/nginx/embrace-app.conf.template:/etc/nginx/templates/embrace-app.conf.template

https

services:
  nginx:
    volumes:
    - ./conf/nginx/embrace-app-ssl.conf.template:/etc/nginx/templates/embrace-app-ssl.conf.template



Inside nginx.conf

# https server
server {
    listen 443 ssl;

    ssl_certificate /etc/ssl/factory-cert.pem;
    ssl_certificate_key /etc/ssl/factory-key.pem;

    client_header_buffer_size 64k;
    large_client_header_buffers 4 64k;
    client_max_body_size 500M;

    location /static/  {
        root /opt;
    }

    access_log /var/log/nginx/nginx_ait_access.log;
    error_log  /var/log/nginx/nginx_ait_error.log;

    location / {
        proxy_pass http://app-server;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 300s;
        proxy_connect_timeout 75s;

        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   REMOTE_HOST      $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $server_name;
        proxy_set_header   X-FORWARDED-PROTOCOL $scheme;
    }
}


Change the value of 

 client_max_body_size 500M;

to (as example)

 client_max_body_size 5G;



Restart the app

With classic RedHat setup:

sudo systemctl restart factory.target


with Docker compose setup:

cd <installer>
./embrace-app.sh --restart


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article