【问题标题】:Increase the size limit of nginx for serving the pdf增加 nginx 的大小限制以提供 pdf
【发布时间】:2011-12-08 12:25:35
【问题描述】:

在我们的网页中加载大约 300KB 大小的 pdf 文件时遇到问题。pdf 文件由 nginx 服务器提供服务。每当我加载文件时,它都会显示错误。(无法打开 pdf 文档)。但是,崩溃文件的大小只有32 KB。我仔细检查了两端的大小。

在服务器端,文件的实际大小是 300KB,而接收端只有 32KB。

在我提到这个clicked_site(client_max_body_size) 之后,我已经添加了配置。它(nginx.conf) 看起来

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;

    **client_max_body_size 200M;**
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;
 }

但它不起作用。你能建议一下吗?

【问题讨论】:

    标签: apache nginx webserver django-staticfiles


    【解决方案1】:

    client_max_body_size与您的案例无关,因为它与文件上传有关。您应该使用其他指令:尝试“sendfile off”以检查它是否与内核副本 fd -> fd 支持有关,使用 output_buffersaio/directio 。这些被描述为here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-27
      • 2023-02-24
      • 1970-01-01
      • 2023-02-15
      • 2023-01-28
      相关资源
      最近更新 更多