How to tutorials, Linux, Linux.Tips, Nginx

How to clear cache on NGINX running on Linux OS?

1 min read

NGINX acts as a content cache, saving copies of content from origin servers and serving them directly to clients, which improves performance and reduces the workload on application servers.

The proxy_cache_path directive specifies the local disk directory for NGINX cache files, configuring settings like directory hierarchy levels, shared memory zones for keys and metadata, maximum cache size, inactivity timeouts, and direct writing to cache directories.

Follow below steps to clear cache on NGINX on Linux OS:

  1. To delete your NGINX cache, first identify your Nginx cache path proxy_cache_path setting in the NGINX configuration file.
  2. In my case Nginx cache path was defined in nginx.conf file located on /etc/nginx/conf.d/nginx.conf with proxy_cache_path directory to be /data/nginx/cache
  3. Remove the cache folder by executing the following command rm -rf /data/nginx/cache/
  4. Restart Nginx to reenable caching


Leave a Reply