Hehe nah, the $ is just there to anchor the test to the end to ensure that "example.php.jpg" is not matched and executed as PHP.

But I am glad you two challenged this addition anyway because it made me remember the rarely-encountered fact that Nginx's rewrite engine stops running any more rules after it finds the first matching location-block.

So, it is not possible to combine both a cache block and a FastCGI block. The expire-rule would have to go inside the FastCGI block, and by that point it's too much of a hassle to be worth doing.

I wouldn't guess anyone has a browser that's so old that it tries to cache .php files these days. Extremely old browsers wouldn't know what the .php file extension meant, and would just see the "text/html" mime type and would apply some automatically determined caching, but I doubt that anyone has browsers *that* old anymore. I'll be removing the check.