I want nginx to deny users who have folders inside /webroot/uploads
e.g.
/webroot/uploads/user1
/webroot/uploads/user2
/webroot/uploads/user999
to execute any shell (php, pl, py, binary).
The shells are often hidden in jpg or gif files. like badfile.php.jpg
I also see malacious binary files being uploaded to the folder.
Here my preliminary rules:
location ~ /webroot/uploads/(.+)\.php$ {
deny all;
}
location ~ /webroot/uploads/(.+)\.pl$ {
deny all;
}
But I am not sure it is robust enough. So I appreciate your help.