1 / 7

How to Enable NGINX Status Page

NGINX status page allows you to monitor NGINX web server health. Here's how to enable NGINX status page for your website. #nginx #webdevelopment <br>Visit https://ubiq.co/tech-blog/how-to-enable-nginx-status-page/

Télécharger la présentation

How to Enable NGINX Status Page

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How To Enable NGINX Status Page

  2. Check if NGINX status page is enabled Most NGINX distributions come with ngx_http_stub_status_module module enabled. You can check if it is enabled in your NGINX installation using the following command # nginx -V 2>&1 | grep -o with-http_stub_status_module --with-http_stub_status_module If you see –with-http_stub_status_module output, it means the status module is already enabled.

  3. Enable status page We will enable NGINX status page by setting up a URL (e.g /status_page) for status page. For this, add a location block in NGINX server configuration as shown below. Open terminal and run the following command to open NGINX server configuration file. $ sudo vi /etc/nginx/nginx.conf If you have configured separate virtual hosts for your website (e.g www.example.com), such as /etc/nginx/sites-enabled/website.conf then open its configuration with the following command $ sudo vi /etc/nginx/sites-enabled/website.conf Add the following location block that will enable stub_status module location /nginx_status { stub_status; allow 127.0.0.1; #only allow requests from localhost deny all; #deny all other hosts }

  4. Enable HTTPS in firewall By default, HTTP port 80 and HTTPS port 443 are blocked in CentOS. Run the following command to open it to allow HTTP and HTTPS traffic. $ sudo firewall-cmd --permanent --add-service=http --add-service=https Reload firewall to apply changes $ sudo firewall-cmd --reload

  5. Restart NGINX Server Run the following command to check syntax of your updated config file. $ sudo nginx -t If there are no errors, run the following command to restart NGINX server. $ sudo service nginx reload #debian/ubuntu $ systemctl restart nginx #redhat/centos

  6. Test NGINX Status Page Run the following command to visit your status page URL using curl command. Replace 127.0.0.1 with your server IP or domain name # curl http://127.0.0.1/nginx_status OR # curl http://www.example.com/nginx_status

  7. Thank You Visit for details https://ubiq.co/tech-blog/how-to-enable-nginx-status-page/

More Related