30.11.2025

How to Monitor Nginx with Zabbix Using Pre-Built Templates

Nginx is a popular and versatile web server frequently used to serve static files, act as a reverse proxy, or balance incoming web traffic. It has earned a reputation for its high performance, stability, and flexibility, making it a preferred choice for many web administrators. Like any critical service, keeping track of Nginx’s health and performance is essential to prevent downtime and quickly identify potential issues. In this guide, we will demonstrate how to monitor Nginx using Zabbix, enabling you to proactively detect anomalies, optimize server performance, and maintain a reliable web environment.

Preparations

Prior to setting up Nginx monitoring in Zabbix, it’s important to confirm that your environment meets all necessary prerequisites. Ensuring these requirements are in place will make the setup process smoother and more reliable. You should have the following prepared:

Configuring Nginx

Open the /etc/nginx/conf.d/stub_status.conf file with the editor of your choice and paste the following text block:

server {
listen 127.0.0.1:80;
server_name 127.0.0.1;
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
location = /basic_status {
stub_status;
allow 127.0.0.1;
allow ::1;
deny all;
}
}


It makes the server generate basic status information on /basic_status page available only from this same server, so our agent can get it to the server.

Now lets check if Nginx procces is fine with new settings by running:

nginx -t
systemctl restart nginx
systemctl status nginx

Next lets's see if the new status page works with curl:

curl http://127.0.0.1/basic_status

Configuring logs

You should check if Nginx generates the logs needed by Zabbix by checking logging settings in /etc/nginx/nginx.conf

Now for Zabbix to work with logs let's comment the original access_log line and paste this fragment:

It should be looking like this:

Check and restart Nginx another time, and let’s get to configuring our Zabbix.

Configuring Zabbix

Assuming that all previous instructions have been completed, you now only need to create a host for this server and add Nginx by Zabbix agent template to it, or add it to an already existing one.

Assign the template to the host running Nginx by going to ConfigurationHostsSelect the hostTemplatesAdd.


If everything is right you must be able to work with the data which is provided by the template:

The Zabbix template also includes a number of triggers alerting you when there is a problem with your Nginx server. These triggers notify you of problems such as high CPU usage, high memory usage, high error rate, and downtime.

For example:

And some items if you want to check something not covered in default graphs or triggers.

Conclusion

By completing this guide, your Nginx server is now fully equipped for monitoring via Zabbix, with an appropriate template configured to capture key performance metrics. This setup enables you to actively observe server behavior, identify potential issues before they escalate, and respond swiftly—ensuring consistent uptime and smooth operation of your applications. With these monitoring capabilities in place, managing Nginx becomes more efficient, giving you full visibility into performance and helping prevent unexpected disruptions.

FAQ