How to Enable NGINX Status Page in Odoo 16

How to Enable NGINX Status Page in Odoo 16

2 minutes, 33 seconds Read

NGINX stands out as a prominent web server and reverse proxy, celebrated for its exceptional performance and scalability. One of its useful features is the status page, which provides real-time information about the server’s performance and activity. Enabling the NGINX status page allows you to monitor server metrics, troubleshoot issues, and optimize server performance. In this blog post, we will walk you through the steps to enable the NGINX status page.

Before enabling the status page, ensure you have NGINX installed on your server. You can check the installation by running the following command in the terminal.

How to Enable NGINX Status Page in Odoo 16-cybrosys

If NGINX is not configured, you can refer to the blog provided at the link below.

How to Configure Odoo with NGINX as Reverse Proxy

To enable the status page, you need to modify the NGINX configuration file. This file’s location may differ based on your operating system and NGINX installation. Typically, the main configuration file is located at /etc/nginx/nginx.conf or /etc/nginx/conf.d/default.conf.

Open the NGINX configuration file using a text editor with root or sudo privileges and  add the following lines of code to the conf file.

location /nginx_status {
        stub_status on;
        access_log off;
        allow 127.0.0.1;  # Only allow requests from localhost
        deny all;  # Deny all other requests
    }

location /nginx_status: Defines the URL path for the status page. You can change /nginx_status to a different path if desired.

stub_status: Enables the status page module.

access_log: Disables the access log for the status page requests.

allow and deny: Restricts access to the status page. In this example, only requests from the local host are allowed. Adjust the IP address or subnet as needed.

Save the file and quit the text editor after making the necessary modifications to the NGINX configuration file.

Before restarting NGINX, it is essential to verify the configuration to ensure there are no syntax errors. Run the following command to check the configuration file for any errors:

How to Enable NGINX Status Page in Odoo 16-cybrosys

With the NGINX status page enabled, you can access it by visiting the configured URL in a web browser. In this example, the status page URL would be http://localhost/nginx_status. If you set a different server name or location, adjust the URL accordingly.

How to Enable NGINX Status Page in Odoo 16-cybrosys

Open connections in total; active connections. A user can establish many connections to a server at once.

The server accepts handled requests: Three values are shown here.

Total accepted connections come first.

The second is the overall number of connections handled. The first two values are typically identical.

The number of handled requests makes up the third value. Usually, this is higher than the second amount.

The number of requests per connection processed by Nginx can be calculated by dividing the third value by the second one.

Reading:Nginx reads the request headers.

Writing: Nginx either processes requests or writes replies to clients after reading request bodies.

Waiting:Keep-Alive connections are awaiting. This quantity is influenced by the keepalive_timeout.

Enabling the NGINX status page provides valuable insights into your server’s performance and helps you diagnose issues more efficiently.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *