How to clear nginx cache manually ?

Normally I like to do manually job.

assume that the default path of your nginx cache is /var/cache/nginx

[code lang=”shell”]
find /var/cache/nginx -type f -delete
[/code]

This will clear all your cache in one line.

Delete a single file from nginx cache

If you just want to delete a single file from nginx cache, you can try this.

[code lang=”shell”]
grep -lr ‘//juzhax.com/wp-content/plugins/jetpack/modules/wpgroho.js’ /var/cache/nginx*
[/code]
Then it will show something like this
/var/cache/nginx/8/45/6025f6b505cd8cbc1172d4e541ac3458

You can safely remove by using rm
[code lang=”shell”]
rm /var/cache/nginx/8/45/6025f6b505cd8cbc1172d4e541ac3458
[/code]

Tags:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.