Question
Adding an NGINX location block for cache exception, but it's giving me a 404 error.
I have a file called loader.js
that I don’t want to cache. So, below is the block of code I have implemented. This is on Django-One-Click app.
# to prevent the caching of loader.js
location ~* loader\.js$ {
add_header Cache-Control "no-store";
}
I ran sudo nginx -t
, it came out successful and restarted nginx. But, once I add the block, loader.js becomes 404. What am I doing wrong?
Thanks.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×