"client_max_body_size" 指令无效值

我也遇到了同样的问题。在我的例子中,它是:

params:
  db_default_text_search_config: "pg_catalog.english"

  ## 将 db_shared_buffers 设置为总内存的最多 25%。
  ## 将由 bootstrap 根据检测到的 RAM 自动设置,或者您可以覆盖它
  db_shared_buffers: "2048MB"

  ## 可以提高排序性能,但会增加每个连接的内存使用量
  db_work_mem: "40MB"

  ## 减小上传大小
  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

但不知何故,它适用于:upload_size: 1m

这确实是无效的,根据 nginx 文档,正确的应该是 1024k,我只看到它接受数字和 SI 乘数。

3 个赞

啊,谢谢 @Falco ,原来是这个问题。

1 个赞

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