Để chống các bạn thêm rule sau vào file vhost: Mã:location /uploads/ { location ~ .*\.(inc|sql|php|cgi|pl|jsp|txt|php5|shtml|html)?$ { deny all; } }
Nếu muốn chặn nhiều thư mục thì dùng rule sau: Mã:location ~* ^/(upload|images)/.*\.(inc|sql|php|cgi|pl|jsp|txt|php5|php4|php3|phtml|shtml)$ { deny all; }
Trường hợp thư mục uploads nằm trong 1 thư mục khác thì dùng rule như sau: Mã:location /wp-content/upload/ { location ~ .*\.(inc|sql|php|cgi|pl|jsp|txt|php5|shtml|html)?$ { deny all; } }