0

nginx 配置增加了try_files $uri $uri.php$is_args$args;一行后,直接访问域名就报错误403 Forbidden,去掉这行才可以,我要保留try_files的配置,请问该如何修改?

server
    {
        listen 80;
        server_name www.aaa.com;
        index index.html index.htm index.php default.html default.htm;
        root  /home/wwwroot/app_htx;

        include none.conf;
        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }

        location / {
                try_files $uri $uri.php$is_args$args;
        }

        access_log  /home/wwwlogs/app.htx.cc.log;
    }

撰写答案