Close access to the one folder using Nginx
server { #... location ^~ /path/to/folder/ { deny all; } #... }
Close access to several folders using Nginx
server { #... location ~* ^/(folder_1|folder_2)($|\/) { deny all; } #... }
After making changes do not forget to restart the Nginx:
service nginx reload
or
service nginx restart