I have 2 servers. First (domain.com) is a django/apache server, second (f1.domain.com) is a file server (nginx). Some files are protected and should only be allowed to be downloaded by registred users. To that end I have setup a nginx server with a
server {
listen 80 default_server;
server_name *.domain.com;
access_log /home/domain/logs/access.log;
location /files/ {
internal;
root /home/domain;
}
}
and from Django I send a request via X-Accel-Redirect header, but it doesn’t work. I think because the request comes from a remote server.
How can I accomplish this task?
“and from django I send a request via X-Accel-Redirect header” — it’s incorrect, the “X-Accel” header must be a part of response header from the upstream server.
As http://wiki.nginx.org/X-accel said, there must be a proxy_pass or fastcgi_pass directive to send the response header to nginx.