[英]Static files served from CIFS Windows share through nginx/Ubuntu aren't fully sent to the browser
我們有一個帶有nginx前端的Rails應用程序。 用戶可以上載存儲在Windows網絡共享上的文件,並在以后檢索它們。 上載的文件通過nginx靜態提供。
例如,下載圖像將僅下載原始圖像的一部分。 服務器返回“ 206部分內容”響應后,刷新頁面將成功下載更多圖像。
通過CIFS連接提供文件似乎存在問題-也許是在確定正確的文件大小? 當然,這不是我們第一次遇到CIFS麻煩。
掛載的fstab條目如下所示:
//aioi-melts1.aioi.local/Staging_Claims /mnt/staging_claims cifs noperm,rw,credentials=/etc/samba/cred-file,uid=root,gid=network,file_mode=0770,dir_mode=0770,umask=0117 0 0
第一個請求的請求/響應標頭如下所示:
Response Headers
Server nginx/0.5.34
Date Wed, 14 Oct 2009 01:34:11 GMT
Content-Type image/jpeg
Content-Length 5274820
Last-Modified Wed, 14 Oct 2009 01:30:05 GMT
Connection keep-alive
Accept-Ranges bytes
Request Headers
Host cx-staging
User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-gb,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Cookie _cx_new_session=29409d54cb14e3d4a9f6aba085e9f447
任何對問題的見解將不勝感激。
謝謝,尼克。
似乎從NFS或CIFS(可能是其他?)掛載中提供文件與nginx“ sendfile”選項不兼容。 關閉sendfile支持已解決我的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.