Disable Access to a folder in Nginx
To disable access to folder /admin in Nginx, add following to server block of your web site.
1 2 3 4 |
location /admin { deny all; return 404; } |
To disable access to some common virtual control software, use
1 2 3 4 5 |
location ~ /\.ht {return 404;} location ~ /\.svn/ {return 404;} location ~ /\.git/ {return 404;} location ~ /\.hg/ {return 404;} location ~ /\.bzr/ {return 404;} |