nginx 根文档目录的子目录 为什么不能自动解析index,php

2025-03-09 12:31:45
推荐回答(2个)
回答1:

nginx 根文档目录的子目录 自动解析index,php
1location ~ ^/upload/.*\.(php|php5)$
{
deny all;
}

其中upload换为你要设置的目录名字

这条规则的含义是匹配请求连接中开头是/upload/,中间匹配任意字符,结尾匹配.php或者.php5的页面,最后利用deny all禁止访问!

回答2:

你要把index.php添加进去