Advertisement
Fany_VanDaal

Vymazlení pro WP Super Cache

Nov 15th, 2021
800
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set $cache_uri $request_uri;
  2.  
  3. # POST requests and urls with a query string should always go to PHP
  4. if ($request_method = POST) {
  5.         set $cache_uri 'null cache';
  6. }
  7. if ($query_string != "") {
  8.         set $cache_uri 'null cache';
  9. }
  10.  
  11. # Don't cache uris containing the following segments
  12. if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php
  13. |wp-.*.php|/feed/|index.php|wp-comments-popup.php
  14. |wp-links-opml.php|wp-locations.php |sitemap(_index)?.xml
  15. |[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
  16.  
  17.         set $cache_uri 'null cache';
  18. }
  19.  
  20. # Don't use the cache for logged-in users or recent commenters
  21. if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+
  22. |wp-postpass|wordpress_logged_in") {
  23.         set $cache_uri 'null cache';
  24. }
  25.  
  26. # Set the cache file
  27. set $cachefile "/wp-content/cache/supercache/$http_host/$cache_uri/index.html";
  28. if ($https ~* "on") {
  29.         set $cachefile "/wp-content/cache/supercache/$http_host/$cache_uri/index-https.html";
  30. }
  31.  
  32.  
  33. #location ~* /wp-includes/.*.php$ {
  34. #    deny all;
  35. #    access_log off;
  36. #    log_not_found off;
  37. #}
  38.  
  39. #location ~* /wp-content/.*.php$ {
  40. #    deny all;
  41. #    access_log off;
  42. #    log_not_found off;
  43. #}
  44.  
  45. location ~* /(?:uploads|files)/.*.php$ {
  46.     deny all;
  47.     access_log off;
  48.     log_not_found off;
  49. }
Advertisement
RAW Paste Data Copied
Advertisement