Thanks for your help but there is still something I don't understand. I have dynamic access for resources. For me, I have 3 different locations in 2 servers and your conf only contains 2. I have my location of the client request, the location of the X-Accel-Redirect and the location where caching happens.
I tried this but it's not working. I got a 200 with an empty body.
server {
listen 80
location /data {
proxy_pass http://127.0.0.1:8081;
}
location /protected_data {
internal;
alias /var/local/data/;
}
}
listen 8081 {
location / {
proxy_pass http://127.0.0.1:8000; #upstream server
proxy_cache my_cache;
proxy_ignore_headers X-Accel-Redirect;
}
}
What am I doing wrong?