访问nginx服务器下*.html文件是提示404错误

来源:互联网 发布:淘宝代理免费加盟 编辑:程序博客网 时间:2024/06/05 10:28

上一篇文章中提到让nginx支持thinkphp重写的方法,如果你用lnmp一键安装包,这一操作会影响所有站点,因为在每个站点配置中都引入了这一配置文件。

server
    {
        listen 8089;
        #listen [::]:80;
        server_name wxoa.dledc.com localhost;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/default/weiqi;


        include n.conf;
        #error_page   404   /404.html;
        include enable-php.conf;


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


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


        location ~ /\.
        {
            deny all;
        }


        access_log off;
    }


只需要将include enable-php.conf; 这一行前加上#号注释掉即可

阅读全文
0 0
原创粉丝点击