How to block all file extensions of certain types on nginx
location
must appear inside server
only, it's not allowed inside http
.
So, the only option is to create a file with your common locations and include
it into your server
s.
Try:
location ~ (\.php$|myadmin) {
return 403;
}