11#! /bin/bash
2- # info: Empty nginx cache
2+ # info: Purge nginx cache
33# options: USER DOMAIN MODE
44# labels: hestia web
55#
6- # example: v-purge-web-domain- nginx-cache user domain.tld proxy
6+ # example: v-purge-nginx-cache user domain.tld proxy
77#
8- # The function clears Nginx cache.
8+ # The function purges nginx cache.
99
1010# ----------------------------------------------------------#
1111# Variable&Function #
@@ -34,34 +34,35 @@ is_object_valid 'web' 'DOMAIN' "$domain" "$FASTCGI_CACHE"
3434# Perform verification if read-only mode is enabled
3535check_hestia_demo_mode
3636
37-
3837# ----------------------------------------------------------#
3938# Action #
4039# ----------------------------------------------------------#
4140
4241# Load domain data
4342parse_object_kv_list $( grep " DOMAIN='$domain '" $USER_DATA /web.conf)
4443
45- # Empty Fast CGI Cache
46- if [ -d /var/cache/nginx/php-fpm /$domain ]; then
47- rm -fr /var/cache/nginx/php-fpm /$domain / *
44+ # Purge nginx FastCGI cache
45+ if [ -d /var/cache/nginx/micro /$domain ]; then
46+ rm -fr /var/cache/nginx/micro /$domain
4847fi
49- # Empty Proxy Cache
48+
49+ # Purge nginx proxy cache
5050if [ -d /var/cache/nginx/$domain ]; then
51- rm -fr /var/cache/nginx/$domain / *
51+ rm -fr /var/cache/nginx/$domain
5252fi
53+
5354# ----------------------------------------------------------#
5455# Hestia #
5556# ----------------------------------------------------------#
5657
5758# Restart services if requested
5859if [ ! -z " $restart " ]; then
5960 $BIN /v-restart-web
60- check_result $? " Web restart failed" > /dev/null
61+ check_result $? " Web restart failed" > /dev/null
6162fi
6263
6364# Logging
64- log_history " purged nginx cache for $domain "
65+ log_history " Purged nginx cache for $domain "
6566log_event " $OK " " $ARGUMENTS "
6667
67- exit
68+ exit
0 commit comments