have such nginx configuration, but cache not working, no file in folder /var/cache/nginx and all responses is 200. What to fix? I tried differend variationts without any result.
fastcgi_cache_path /var/cache/nginx/ levels=2 keys_zone=workfolder:10m max_size=512m inactive=20m;
server {
listen 80;
client_max_body_size 10m;
client_header_buffer_size 4k;
access_log /srv/logs/site-access.log;
error_log /srv/logs/site-error.log;
root /srv/www/Site;
server_tokens off;
server_name_in_redirect off;
charset utf-8;
fastcgi_intercept_errors on;
#index index.php index.html index.htm;
fastcgi_pass_header Cookie;
fastcgi_cache wahoos;
fastcgi_cache_key $request_method|$host|$request_uri;
fastcgi_cache_valid 301 8h;
fastcgi_cache_valid 404 1h;
fastcgi_cache_valid 200 15m;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}
location @php {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /srv/www/Site/index.php;
}
location /api {
fastcgi_cache off;
}
location ~ \.(css|js|txt|jpg|jpeg|png)$
{
access_log off;
expires 1d;
add_header Pragma public;
add_header Cache-Control private;
}
}