I use nginx to as the front server, I have modified the CSS files, but nginx is still serving the old ones.
I have tried to restart nginx, to no success and I have Googled, but not found a valid way to clear it.
Some articles say we can just delete the cache directory: var/cache/nginx
, but there is no such directory on my server.
What should I do now?
There is one right method to remove only cache-files, which matches any KEY. For example:
This removes all cache-files, which matches to KEY "yahoo/*", if in nginx.conf was set:
Unless you configured a cache zone via proxy_cache_path and then used it (for example in a location block), via: proxy_cache nothing will get cached.
If you did, however, then according to the author of nginx, simply removing all files from the cache directory is enough.
Simplest way:
find /path/to/your/cache -type f -delete
There's two answers in this question.
Use:
E.G.:
I run a very simple bash script which takes all of 10 seconds to do the job and sends me a mail when done.
I was experiencing a kind of similar issue:
System setup and Problem: (On a virtualbox I'm web hosting using ubuntu and nginx - PHP webpage refreshes did not reflect changes to external css file). I'm developing website on windows machine and transferring files to nginx via shared folder. It seems nginx does not pick up changes to css file (refreshing in any fashion does not help. Changing css file name is only thing that worked)
Solution: On VM find shared file (css file in my case). Open with nano and compare to file in windows share (they appear identical). On VM save shared file with nano. All changes are now reflected in browser. Not sure why this works but it did in my case.
UPDATE: After rebooting the VM server the problem returned. Following the instructions under Solution made the css responsive to updates again
I found this useful
Search, and if found then delete.