I want all urls under /media/thumbnails to be served from disk, and if the file doesn't exist, from another server, but without redirecting the client. I believed this should work but I can't find what is wrong with it:
location /media/thumbnails {
try_files $uri @thumbnail_generator;
}
location /media {
root /home/plinio/nginx_test;
break;
}
location @thumbnail_generator {
proxy_pass http://127.0.0.1:8081/media_generate$uri;
}
Even after creating the /home/plinio/nginx_test/media/thumbnails/test.txt file, a request to /media/thumbnails/test.txt is still being internally redirected to @thumbnail_generator.