I have the same issue but with the paid WAF Nginx. I have reinstalled both Nginx (as compiled this time) and WAF Nginx but it still has the same error.
ERROR: An error was detected in the configuration file. Please solve it before proceeding
nginx: [emerg] unknown directive "lua_shared_dict" in /www/server/panel/vhost/nginx/btwaf.conf:1
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed