Files
EasyImages2.0/docs/安全配置.md
2023-03-11 00:36:37 +08:00

26 lines
588 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- Apache环境在上传目录添加配置文件`.htaccess` 使上传目录不可运行PHP程序默认已经存在)
```Apache
<FilesMatch "\.(?i:php|php3|php4|php5)">
Order allow,deny
Deny from all
</FilesMatch>
```
- Nginx环境禁止多个目录运行`PHP`程序:
```Nginx
# "i|public"是你要禁止的目录 放到listen段落之后才生效
location ~* ^/(config|docs|i|public)/.*\.(php|php5)$ {
deny all;
}
```
- Lighthttpd环境禁止多个目录运行`PHP`程序:
```Lighthttpd
$HTTP["url"] =~ "^/(config|docs|i|public)/" {
fastcgi.server = ()
}
```