# "client\_max\_body\_size" directive invalid value

**URL:** https://meta.discourse.org/t/client-max-body-size-directive-invalid-value/258754
**Category:** Self-hosting
**Created:** [March 19, 2023, 5:22pm UTC](https://meta.discourse.org/t/client-max-body-size-directive-invalid-value/258754 "2023-03-19T17:22:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)
#### Post date: [March 19, 2023, 5:22pm UTC](https://meta.discourse.org/t/client-max-body-size-directive-invalid-value/258754/1 "2023-03-19T17:22:11Z")

</div>

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

```plaintext
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

```

```plaintext
[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`

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 19, 2023, 8:07pm UTC](https://meta.discourse.org/t/client-max-body-size-directive-invalid-value/258754/2 "2023-03-19T20:07:24Z")

</div>

> [@rahim123](#):
>
> ` upload_size: 1024kb`

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

---

<div class="post-metadata">

### Author: ![rahim123](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rahim123](https://meta.discourse.org/u/rahim123)
#### Post date: [March 19, 2023, 8:28pm UTC](https://meta.discourse.org/t/client-max-body-size-directive-invalid-value/258754/3 "2023-03-19T20:28:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 18, 2023, 8:28pm UTC](https://meta.discourse.org/t/client-max-body-size-directive-invalid-value/258754/4 "2023-04-18T20:28:13Z")

</div>

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