Serving protected files with Django and Nginx X-accel-redirect
问题 I'm trying to get Nginx and Django to play together to serve downloadable protected files. I just cannot get it to work. Here's my Nginx config: location ~ ^.*/protected-test/ { alias /<path-to-my-protected-files-on-server>/; internal; } the relevant urls.py for viewing the file(s): url(r'^static_files/downloads/protected-test/(?P<filename>.+)$', 'download_or_view', {'download_dir': '%s%s' % (settings.MEDIA_ROOT, 'downloads/protected-test/'), 'content_disposition_type': 'inline', 'protected':