How to increase the upload file size limit? Error shown

AI-generated summary

The discussion revolves around increasing the upload file size limit in Discourse. The original poster, prty_grl, tried adjusting the settings and adding a configuration to app.yml, but was unsuccessful. omarfilip provided an alternative solution by adding custom commands to app.yml to modify the discourse.conf file, which worked for prty_grl. The solution involves adding the following to the bottom of app.yml:

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;

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;

It worked. Thank you.