location /protected/ {
        internal;
        root <complete path to project root dir>;
    }

def media_nginx_accel(request, path):
    """
    location /protected/ {
        internal;
        root <complete path to project root dir>;
    }

    """
    response = HttpResponse(status=200)
    response['Content-Type'] = ''
    response['X-Accel-Redirect'] = '/protected' + request.path
    return response