Если вы пытаетесь выполнить выборочную очистку страниц на Drupal , то я бы порекомендовал вам прочитать эту статью, так как она немного длинная.
Подводя итог основным этапам:
- Убедитесь, что на вашем сервере Nginx установлен модуль ngx_cache_purge.
включить / etc / nginx / fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/$host/drupal/index.php;
fastcgi_hide_header X-Drupal-Cache; #необязательный
fastcgi_hide_header Etag; #необязательный
fastcgi_pass php;
# Настройки кеша
установить $ nocache "";
if ($ http_cookie ~ SESS) {# зарегистрированные пользователи должны обходить кеш
установить $ nocache "Y";
}
if ($ request_uri ~ \?) {# Очистка еще не обрабатывает строки запроса
установить $ nocache "Y";
}
fastcgi_cache mycache;
fastcgi_cache_key $ host $ request_uri;
fastcgi_cache_valid 200 301 1d;
fastcgi_ignore_headers Срок действия Cache-Control истекает;
fastcgi_cache_bypass $ nocache;
fastcgi_no_cache $ nocache;
add_header X-nginx-Cache $ upstream_cache_status; #необязательный
истекает эпоха;
}
Create a new server listening on a random port on the localhost interface.
- Enable the Purge and Expire modules and set the proxy URL at admin/settings/purge to
"http://127.0.0.1:8888"
.
and your are done!!
The source of the article: nginx caching with selective page purging
ответ дан
4 December 2019 в 17:36
Ссылка