2011-12-08 87 views
0

我們在加載大約300KB大小的pdf文件時遇到了問題.PDF文件通過nginx服務器正在服務器中。每當我加載文件時它顯示錯誤(無法打開pdf文件)。但是,崩潰文件的大小隻有32 KB。我已經仔細檢查了兩端的大小。增加nginx的大小限制來提供pdf

在服務器端,文件的實際大小爲300KB,接收端只有32KB。

我提到這個clicked_site(client_max_body_size)後,我又增加了configuration.It(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; 
} 

,但它不工作out.Could請你提出這個?

回答

0

client_max_body_size與您的情況無關,因爲它與文件上傳有關。您應該玩其他指令:嘗試「sendfile off」以檢查它是否與內核副本fd - > fd支持相關,請使用output_buffersaio/directio。這些被描述爲here