How to increase the upload file size limit? Error shown

The composer shows that I exceed the file size limit.

I want to increase the upload file size (attachments) in composer. So, I increased it in the settings. I noticed I have to increase it nginx as well. But I don’t use nginx and it has been disabled in AWS (and I don’t want to use reverse proxy as ssl and everything will need to be set up).

I don’t see any nginx in the application folder after I do the following, it opens up with empty file.

sudo ./launcher enter app
cd /etc/nginx/conf.d/
nano discourse.conf'

I listed the files as well, but it doesn’t even have “etc” folder in it.

That means nginx is not even present in the discourse folder.

Then as an alternative, I added file size under params, hoping that discourse would pick the setting up after rebuild.

sudo nano containers/app.yml

params:
    nginx:
    client_max_body_size: 1000m

But no success. Still shows the error file size should not exeed bla bla bla.

Add this at the bottom of your app.yml in custom commands, then rebuild:

## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"
  - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /client_max_body_size.+$/
        to: client_max_body_size 1000m;
1 Like

It worked. Thank you.

1 Like