I found it's the line including all website nginx configs
include /www/server/panel/vhost/nginx/*.conf;
If i comment it i can save the config and do anything with nginx but it doesn't work as it doesn't have the website configs, but if it's uncommented i get the beginning error
nginx: [emerg] unknown directive "set_by_lua_block" in /www/server/panel/vhost/nginx/well-known/control.REDACTED.conf:4
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
/www/server/panel/vhost/nginx/well-known/control.REDACTED.conf:4 File content
set $well_known '';
if ( $uri ~ "^/.well-known/" ) {
set_by_lua_block $well_known {
--get path
local m,err = ngx.re.match(ngx.var.uri,"/.well-known/(.*)","isjo")
-- If the path matches
if m then
-- Splicing file path
local filename = ngx.var.document_root .. m[0]
-- Determine if the file path is legal
if not ngx.re.find(m[1],"\\./","isjo") then
-- Determine if the file exists
local is_exists = io.open(filename, "r")
if not is_exists then
-- Java project?
filename = "/www/wwwroot/java_node_ssl" .. m[0]
end
-- release
if is_exists then is_exists:close() end
-- read file
local fp = io.open(filename,'r')
if fp then
local file_body = fp:read("*a")
fp:close()
if file_body then
ngx.header['content-type'] = 'text/plain'
return file_body
end
end
end
end
return ""
}
}
if ( $well_known != "" ) {
return 200 $well_known;
}
This file is included by /www/server/panel/vhost/nginx/control.REDACTED.conf on the line 12
include /www/server/panel/vhost/nginx/well-known/control.REDACTED.conf;
What should i do now?