将以下代码添加至Server容器中的合适位置,也就是在定义fastcgi的规则之前.
location ~* ^/images/.*\.(php|php5)$
{
deny all;
}
下面给个目前Sino Unix™论坛的部分nginx配置
server
{
listen 80;
server_name bbs.sinounix.com;
index index.php index.htm index.html;
location ~* ^/sudata/.*\.(php|php5)$
{
deny all;
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
root /var/www/Discuz/;
}