In my nginx config file I have this location
block (modified for debugging purposes):
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires 1;
log_not_found off;
return 515 "Request URI is $request_uri. Caught you";
}
When I request this URI from the server:
/img/signup/be0e1d34fabf2514d49db9baec09f858.png?w=198&h=198&s=9a7d22504c5ae176a936a0f18cccacba
sure enough, it matches and I get a 515 response with this body:
Request URI is /img/signup/be0e1d34fabf2514d49db9baec09f858.png?w=198&h=198&s=9a7d22504c5ae176a936a0f18cccacba. Caught you
Why? The regex doesn't match, at least not intuitively (either it must end in a question mark followed by a series of digits, or in .png
etc.), nor when I sense-checked it at Regex101.com.