当我修改了静态网站的配置文件后服务异常

    location /sgz {
    content_by_lua_block {
        -- 引入的模块
        local cjson = require "cjson"
        local file = io.open("/www/sites/********/index/sgz.json", "r") 

        if not file then
            ngx.say("Failed to read sgz.json")
            return
        end

        local content = file:read("*a") -- 读取文件内容
        file:close()

        local data = cjson.decode(content) -- 解析json数据

        -- 获取请求参数
        local args = ngx.req.get_uri_args()
        local question = args["question"]

        if not question then
            ngx.say("没有参数")
            return
        end

        -- 遍历json数据,查找匹配的问题
        for _, item in ipairs(data) do
            if item["question_name"] == question then
                ngx.say(item["right_name"]) -- 返回匹配的答案
                return
            end
        end

        -- 如果没有找到匹配的问题,返回错误信息
        ngx.say("没有找到该题目")
    }
}

当我添加了以上内容至配置文件后,无法进行修改和查看该域名下的日志、安全等

操作本域名下的任何东西都显示服务异常,别的域名却可以

配置文件中存在错误 所以很多修改配置文件的操作会报错

那为什么日志都查看不了:astonished:

先把添加的东西都去掉 然后再看看