"client_max_body_size" directive invalid value

I ran into this problem too. In my case it was:

params:
  db_default_text_search_config: "pg_catalog.english"

  ## Set db_shared_buffers to a max of 25% of the total memory.
  ## will be set automatically by bootstrap based on detected RAM, or you can override
  db_shared_buffers: "2048MB"

  ## can improve sorting performance, but adds memory usage per-connection
  db_work_mem: "40MB"

  ## Reduce max upload size
  upload_size: 1024kb
[Sun 19 Mar 2023 04:42:50 PM UTC] Run reload cmd: sv reload nginx
warning: nginx: unable to open supervise/ok: file does not exist
[Sun 19 Mar 2023 04:42:50 PM UTC] Reload error for :
Started runsvdir, PID is 551
nginx: [emerg] "client_max_body_size" directive invalid value in /etc/nginx/conf.d/discourse.conf:112
ok: run: redis: (pid 564) 0s
ok: run: postgres: (pid 563) 0s
supervisor pid: 565 unicorn pid: 587
nginx: [emerg] "client_max_body_size" directive invalid value in /etc/nginx/conf.d/discourse.conf:112
nginx: [emerg] "client_max_body_size" directive invalid value in /etc/nginx/conf.d/discourse.conf:112

But for whatever reason it does work with: upload_size: 1m

That’s invalid indeed, the correct would be 1024k as per nginx docs I only see it accept numbers and SI multipliers.

3 Likes

Ahh, thanks @Falco , so that was the problem.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.