The nginx configuration method is shown in the following figure.
The code is as follows: |
Copy code |
Location/upload /{ Location ~ . * \. (Php )? $ { Deny all; } } Location ~ * ^/(Upload | images)/. * \. (php | php5) $ { Deny all; } |
In Apache, we configure the following:
The code is as follows: |
Copy code |
<Directory/webroot/attachments> Php_flag engine off </Directory> |
In lighthttpd, we configure the following:
The code is as follows: |
Copy code |
$ HTTP ["url"] = ~ "^/(Forumdata | templates | upload | images )/"{ Fastcgi. server = () } |
Disable dangerous files in the iis Directory
Step 2: Open iis in the same way as IIS6.0, find the directory to be disabled in the website directory, select it, and double-click "handler ing" in the control panel ".
Step 2: Find and click edit function permission on the right. In the edit function permission dialog box that appears, remove the check box before the script and click OK.
Step 2: After the execution, the executable files related to php, jsp, and related directory settings on the website cannot be executed.