Enable nginx Status Module Page for Monitoring
-
Would it be possible to add a status page location (https://nginx.org/en/docs/http/ngx_http_stub_status_module.html) to the default configuration file for Nginx? This would allow us to monitor the Nginx service more easily.
We have already integrated Cloudron into our monitoring system and we would like to be able to monitor Nginx more closely as well and gain access to Nginx metrics to better understand and monitor our server's performance.
In order to use the Nginx status module, you would need to add a new location block under the server section in the default.conf file located at
/etc/nginx/applicationsfor the http connection (port 80). You should also include allow and deny statements in this block to protect the page from being accessed outside of your server:location = /basic_status { stub_status; allow 127.0.0.1; allow ::1; deny all; }Here is an example of what you will see when you use cURL with the following request:
curl 127.0.0.1/basic_status:Active connections: 291 server accepts handled requests 16630948 16630948 31070465 Reading: 6 Writing: 179 Waiting: 106The above request will provide live information on how many requests are being served, requests processed per second, and the number of active connections, as well as the number of connections currently being made. Additionally, if you create a simple calculation after recording these metrics over time, you can also calculate connections accepted per second, connections dropped per second and connections handled per second.
We put the change into place on one of our Cloudron instances and we are seeing that it is working and the data comes through, but we expect that there will be a future point that will cause the change to be wiped out again when updates occur.
Maybe it would be possible to have some of this metric information also showing directly within the dashboard of Cloudron when the status page is activated? It would be an added bonus to be able to provide users of Cloudron better insight into how their server is performing.