Hello,
I uninstalled the Nginx WAF plugin in aaPanel and then reinstalled it. Since then I’m facing the following issue:
• When I try to disable Nginx WAF or restart Nginx, I immediately get an error.
• Even when I open and try to save the nginx.conf file in the aaPanel file manager/browser, the same error pops up.
Error Message:
nginx: [emerg] unknown "waf_ip_remote_addr" variable
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
Analysis:
• The variable $waf_ip_remote_addr is being used in
/www/server/panel/vhost/nginx/0.monitor_log_format.conf at line 25:
'"waf_ip_remote_addr":"$waf_ip_remote_addr",'
• However, this variable is not defined anywhere in nginx.conf or in any included file.
• Because of this, every nginx -t test fails, and aaPanel does not allow me to save any configuration files.
Expected Behavior:
After reinstalling the WAF plugin, Nginx should restart without errors. The variable $waf_ip_remote_addr should either be defined automatically or not referenced when the plugin is not active.
Request for Help:
• How can I properly restore or define this variable?
• Or alternatively, how can I remove the faulty log reference in the WAF plugin so that Nginx can start normally again?
