I am trying to cache different location with different cache keyzone but it is not working. Cache is only working for the root "/" location.
If I turn off the cache for location "/" then still it does not work for other location.
Http block:
fastcgi_cache_path /webcache/nginx levels=1:2 keys_zone=microcache:100m max_size=1000m inactive=45m use_temp_path=off; fastcgi_cache_path /webcache/extreme levels=1:2 keys_zone=extreme:100m max_size=10400m inactive=99999m use_temp_path=off; fastcgi_cache_key "$scheme$request_method$host$request_uri"; Server block:
location ~* "^/(20[0-1][0-8]/)" { try_files $uri $uri/ /index.php?$args; location ~ \.php$ { try_files $uri = 404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/opt/remi/php56/run/php-fpm/php-fpm.sock; fastcgi_index index.php; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; fastcgi_cache_key "$scheme$request_method$host$request_uri"; fastcgi_no_cache $no_cache; fastcgi_cache_bypass $no_cache; fastcgi_cache extreme; fastcgi_cache_min_uses 1; fastcgi_cache_methods GET HEAD; fastcgi_cache_lock on; fastcgi_cache_lock_age 5s; fastcgi_cache_lock_timeout 5s; fastcgi_cache_valid 200 302 301 8760h; fastcgi_cache_valid 500 502 10s; fastcgi_cache_valid 403 404 10s; fastcgi_cache_use_stale updating error timeout invalid_header http_500; fastcgi_cache_background_update on; fastcgi_pass_header Set-Cookie; fastcgi_pass_header Cookie; } location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri = 404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/opt/remi/php56/run/php-fpm/php-fpm.sock; fastcgi_index index.php; include /etc/nginx/fastcgi_params; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_no_cache $no_cache; fastcgi_cache_bypass $no_cache; fastcgi_cache microcache; fastcgi_cache_min_uses 1; fastcgi_cache_methods GET HEAD; fastcgi_cache_lock on; fastcgi_cache_lock_age 5s; fastcgi_cache_lock_timeout 5s; fastcgi_cache_valid 200 302 301 1m; fastcgi_cache_valid 500 502 10s; fastcgi_cache_valid 403 404 10s; fastcgi_cache_use_stale updating error timeout invalid_header http_500; fastcgi_cache_background_update on; fastcgi_pass_header Set-Cookie; fastcgi_pass_header Cookie; fastcgi_ignore_headers Cache-Control Expires Set-Cookie; }
/2xxx/...URIs get handled by/index.php?