I did everything as described, but it just is not working. Is there any way to know Microcaching Nginx is active? I put it to the server to report in the HTTP headers, but it just does not seem to work:
-rw-r--r-- 1 root root 1952 Oct 18 02:08 /usr/local/psa/admin/conf/templates/custom/nginx.php
<?php echo AUTOGENERATED_CONFIGS; ?>
<?php /** @var Template_VariableAccessor $VAR */ ?>
<?php /** @var Template_Variable_IpAddress $ipAddress */ ?>
include "<?php echo $VAR->server->nginx->httpConfDir ?>/plesk.conf.d/ip_default/*.conf";
<?php echo $VAR->includeTemplate('server/nginxVhosts.php', array(
'ssl' => false,
'frontendPort' => $VAR->server->nginx->httpPort,
'backendPort' => $VAR->server->webserver->httpPort,
)) ?>
<?php echo $VAR->includeTemplate('server/nginxVhosts.php', array(
'ssl' => true,
'frontendPort' => $VAR->server->nginx->httpsPort,
'backendPort' => $VAR->server->webserver->httpsPort,
)) ?>
<?php /* Next block used for watchdog */ ?>
<?php if (!$VAR->server->ipAddresses->hasIpV4Address): ?>
server {
listen 127.0.0.1 default_server;
return 200;
}
server {
fastcgi_ignore_headers Cache-Control Expires;
fastcgi_cache_path /tmp/cache levels=1:2 keys_zone=thelastcicada:900m inactive=10m max_size=100m;
fastcgi_cache_key "$scheme://$host$request_method$request_uri";
#Cache everything by default
set $no_cache 0;
#Don't cache logged in users or commenters
if ( $http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {
set $no_cache 1;
}
#Don't cache the following URLs
if ($request_uri ~* "/(wp-admin/|wp-login.php)")
{
set $no_cache 1;
}
#matches keys_zone in fastcgi_cache_path
fastcgi_cache thelastcicada;
#don't serve pages defined earlier
fastcgi_cache_bypass $no_cache;
#don't cache pages defined earlier
fastcgi_no_cache $no_cache;
#defines the default cache time
fastcgi_cache_valid any 10s;
#unsure what the impacts of this variable is
fastcgi_max_temp_file_size 2M;
#Use stale cache items while updating in the background
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
fastcgi_cache_lock on;
fastcgi_cache_lock_timeout 10s;
fastcgi_cache_key “$scheme://$host$request_method$request_uri”;
}
<?php endif ?>