Error loading static file from a NAS (CIFS mounted) Not 404...

27 views
Skip to first unread message

Hua Liang

unread,
Feb 27, 2023, 9:29:12 AM2/27/23
to Django users
Hello,

I have a django site and I have two storages serving static files.
One is a hard drive attached to the server and the other is a NAS share.

Both are mounted and I can view the files in Ubuntu without any problems.

Both are linked to Django static folder.

The problem is that when I tried to access the file from Django web, the NAS one always fails with corrupted file.
e.g. I have an image file image.jpg in both local drive and NAS share

lets say "static/media1" is linked to the local drive, and "static/media2" is linked to the nas share
if I visit
if I visit
http://django-site-ip/static/media2/image.jpg, it is corrupted. (but I can view it in ubuntu)

I downloaded the image from the site and I found that the size is different compared to the original file.

Anyone knows what the issue is?

Thanks

Hua Liang

unread,
Feb 27, 2023, 8:30:24 PM2/27/23
to Django users

Okay I think I know the problem.

Apache2 has a bug with CIFS, set EnableMMAP Off in config will solve this.
Reply all
Reply to author
Forward
0 new messages