I have -unfortunately Windows- Nginx server that I use for a static content (like product photos and so on). Currently I have had a global setting for caching, but now I need to change it little.
I have a folder which path looks something like this:
E:\xampp\srv\project-files\projectX\files\users\user-hash\visualisator\views
As you can see in the path is the user-hash variable which changes. And in this folder I have *.jpg files that need to have cache disabled.
I have already tried something like this (located on top of the other (global) location settings):
location ~ /users/ {
alias "E:/xampp/srv/project-files/projectX/files/users";
expires -1;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
}
And I have been hoping that it will at least disable cache for all the files in this folder and further. But the only result I am getting from this is http 403
.
I can live with disabled cache from the folder users
and further if it will works, but the best solution would be to disable cache for the whole path (with user-hash variable included) and just for a specific file type (*.jpg).
Any idea or recommendation how to achieve this? PS: NGinx is new for me, I have spent like 8 hours tops with this technology, so sorry if it is stupid question, but I can't possibly figure it out or find it anywhere.
Thank you in advance!