server { listen 80; server_name php-cache.local; root /var/www/nginx/examples/php-cache; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \index.php$ { internal; include snippets/fastcgi-php.conf; } location /static-text { try_files $uri /index_cached_1h.php?$args; } location ~ \index_cached_1h.php$ { internal; fastcgi_cache_key "$scheme$request_method$host$request_uri$http_language"; fastcgi_cache cache_1h; fastcgi_cache_valid 1h; add_header Cache-Status "$upstream_cache_status, 1h" always; include snippets/fastcgi-php.conf; } }