Send NGINX Logs to Wazuh
This guide assumes the Wazuh agent is already installed on the server running NGINX.
Open and edit the Wazuh configuration file:
Terminal
sudo nano /var/ossec/etc/ossec.conf
Locate the Log Analysis block, then add the following lines:
<localfile>
<log_format>apache</log_format>
<location>/var/log/nginx/access.log</location>
</localfile>
<localfile>
<log_format>syslog</log_format>
<location>/var/log/nginx/error.log</location>
</localfile>
Locate the Syscheck block, then add the following line below "Directories to check":
<directories realtime="yes">/var/www</directories>
Press CTRL+O to save the file, then press CTRL+X to exit.
Restart the Wazuh agent:
Terminal
sudo systemctl restart wazuh-agent