Ok, I almost give up on this, but how can I turn off caching from Nginx for JavaScript files? I am using a docker container with Nginx. When I change something in the JavaScript file now, I need a few reboots until a new file appears.
How do I know Nginx and not browser / docker?
Browser: I used curl
on the command line to simulate a request and had the same problems. In addition, I use the CacheKiller
plugin and the cache is disabled in Chrome Dev Tools.
Docker: when I connect to the bash container and use cat
after changing the file, I immediately get the correct result.
I changed my nginx.conf
to sites-enabled
on this (which I found in another stackoverflow thread)
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|xml|html|htm)$ {
However, after restoring the containers (and make sure it is in the container with cat
), it still does not work. This is the full .conf
server { server_name app; root /var/www/app/web;
source share