{"id":13796,"date":"2019-04-06T08:20:35","date_gmt":"2019-04-06T08:20:35","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13796"},"modified":"2019-04-06T08:20:35","modified_gmt":"2019-04-06T08:20:35","slug":"how-to-enable-nginx-status-page","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/how-to-enable-nginx-status-page\/","title":{"rendered":"How to Enable NGINX Status Page"},"content":{"rendered":"<p><strong>Nginx<\/strong>\u00a0is a free open source, high-performance, reliable, scalable and fully extensible web server, load balancer and reverse proxy software. It has a simple and easy-to-understand configuration language. It also supports a multitude of modules both\u00a0<strong>static<\/strong>\u00a0(which have existed in Nginx since the first version) and\u00a0<strong>dynamic<\/strong>\u00a0(introduced in version\u00a0<strong>1.9.11<\/strong>).<\/p>\n<p>One of the important modules in Nginx is the\u00a0<strong>ngx_http_stub_status_module<\/strong>\u00a0module which provides access to basic Nginx status information via a \u201c<strong>status page<\/strong>\u201d. It shows information such as total number of active client connections, those accepted, and those handled, total number of requests and number of reading, writing and waiting connections.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/amplify-nginx-monitoring-tool\/\" target=\"_blank\" rel=\"noopener\">Amplify \u2013 NGINX Monitoring Made Easy<\/a><\/p>\n<p>On most Linux distributions, the\u00a0<strong>Nginx<\/strong>\u00a0version comes with the\u00a0<strong>ngx_http_stub_status_module<\/strong>\u00a0enabled. You can check out if the module is already enabled or not using following command.<\/p>\n<pre># nginx -V 2&gt;&amp;1 | grep -o with-http_stub_status_module\r\n<\/pre>\n<div id=\"attachment_29585\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Check-Nginx-Status-Module.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29585\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Check-Nginx-Status-Module.png\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Check-Nginx-Status-Module.png 799w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Check-Nginx-Status-Module-768x63.png 768w\" alt=\"Check Nginx Status Module\" width=\"799\" height=\"66\" aria-describedby=\"caption-attachment-29585\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29585\" class=\"wp-caption-text\">Check Nginx Status Module<\/p>\n<\/div>\n<p>If you see\u00a0<code>--with-http_stub_status_module<\/code>\u00a0as output in the terminal, means the status module is enabled. If the above command returns no output, you need to\u00a0<a href=\"https:\/\/www.tecmint.com\/install-nginx-in-centos-7\/\" target=\"_blank\" rel=\"noopener\">compile NGINX from source<\/a>\u00a0using the\u00a0<strong>\u2013with-http_stub_status_module<\/strong>\u00a0as configuration parameter as shown.<\/p>\n<pre># wget http:\/\/nginx.org\/download\/nginx-1.13.12.tar.gz\r\n# tar xfz nginx-1.13.12.tar.gz\r\n# cd nginx-1.13.12\/\r\n# .\/configure --with-http_stub_status_module\r\n# make\r\n# make install\r\n<\/pre>\n<p>After verifying the module, you will also need to enable\u00a0<strong>stub_status<\/strong>\u00a0module in the\u00a0<strong>NGINX<\/strong>\u00a0configuration file\u00a0<strong>\/etc\/nginx\/nginx.conf<\/strong>\u00a0to set up a locally reachable URL (e.g.,\u00a0<strong>http:\/\/www.example.com\/nginx_status<\/strong>) for the status page.<\/p>\n<pre>location \/nginx_status {\r\n \tstub_status;\r\n \tallow 127.0.0.1;\t#only allow requests from localhost\r\n \tdeny all;\t\t#deny all other hosts\t\r\n }\r\n<\/pre>\n<div id=\"attachment_29586\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Enable-Nginx-Status-Page.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29586\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Enable-Nginx-Status-Page.png\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Enable-Nginx-Status-Page.png 774w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Enable-Nginx-Status-Page-768x422.png 768w\" alt=\"Enable Nginx Status Page\" width=\"774\" height=\"425\" aria-describedby=\"caption-attachment-29586\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29586\" class=\"wp-caption-text\">Enable Nginx Status Page<\/p>\n<\/div>\n<p>Make sure to replace\u00a0<strong>127.0.0.1<\/strong>\u00a0with your server\u2019s IP address and also make sure that this page accessible to only you.<\/p>\n<p>After making configurations changes, make sure to check nginx configuration for any errors and restart the nginx service to effect the recent changes using following commands.<\/p>\n<pre># nginx -t\r\n# nginx -s reload \r\n<\/pre>\n<div id=\"attachment_29587\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Check-Nginx-Configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29587\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Check-Nginx-Configuration.png\" alt=\"Check Nginx Configuration\" width=\"743\" height=\"107\" aria-describedby=\"caption-attachment-29587\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29587\" class=\"wp-caption-text\">Check Nginx Configuration<\/p>\n<\/div>\n<p>After reloading nginx server, now you can visit the Nginx status page at the below URL using curl program to see your metrics.<\/p>\n<pre># curl http:\/\/127.0.0.1\/nginx_status\r\nOR\r\n# curl http:\/\/www.example.com\/nginx_status\r\n<\/pre>\n<div id=\"attachment_29588\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Check-Nginx-Status-Page.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29588\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/05\/Check-Nginx-Status-Page.png\" alt=\"Check Nginx Status Page\" width=\"596\" height=\"139\" aria-describedby=\"caption-attachment-29588\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29588\" class=\"wp-caption-text\">Check Nginx Status Page<\/p>\n<\/div>\n<p><strong>Important<\/strong>: The\u00a0<strong>ngx_http_stub_status_module<\/strong>\u00a0module has been superseded by the\u00a0<strong>ngx_http_api_module<\/strong>module in\u00a0<strong>Nginx 1.13.0<\/strong>\u00a0version.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/enable-monitor-php-fpm-status-in-nginx\/\" target=\"_blank\" rel=\"noopener\">How to Enable PHP-FPM Status Page in Nginx<\/a><\/p>\n<p>That\u2019s all! In this article, we have showed how to enable Nginx status page in Linux. Use the comment form below to ask any questions.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/enable-nginx-status-page\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nginx\u00a0is a free open source, high-performance, reliable, scalable and fully extensible web server, load balancer and reverse proxy software. It has a simple and easy-to-understand configuration language. It also supports a multitude of modules both\u00a0static\u00a0(which have existed in Nginx since the first version) and\u00a0dynamic\u00a0(introduced in version\u00a01.9.11). One of the important modules in Nginx is the\u00a0ngx_http_stub_status_module\u00a0module &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/how-to-enable-nginx-status-page\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Enable NGINX Status Page&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13796","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13796"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13796\/revisions"}],"predecessor-version":[{"id":13797,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13796\/revisions\/13797"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}