Add an NGINX instance

This guide shows you how to add NGINX Open Source and NGINX Plus instances to F5 NGINX Instance Manager so you can manage them from a central dashboard.

Before you begin

Make sure you have:

Add instances

  1. Open the NGINX Instance Manager web interface and log in.

  2. In the Manage section on the left, select Instances.

  3. Select Add.

  4. Copy the curl command.

  5. On the host where your NGINX instance is running, run the curl command to install NGINX Agent:

    curl https://<NIM-FQDN>/install/nginx-agent | sudo sh
  6. On the same host, run the following command to start NGINX Agent:

    sudo systemctl start nginx-agent

Set up metrics reporting

Enable NGINX Plus API

To collect comprehensive metrics for NGINX Plus–including bytes streamed, information about upstream systems and caches, and counts of all HTTP status codes–add the following to your NGINX Plus configuration file (for example, /etc/nginx/nginx.conf or an included file):

# Enable the /api/ location with appropriate access control
# to use the NGINX Plus API.
#
location /api/ {
    api write=on;
    allow 127.0.0.1;
    deny all;
}

This configuration:

  • Enables the NGINX Plus API.
  • Allows requests only from 127.0.0.1 (localhost).
  • Blocks all other requests for security.

For more details, see the NGINX Plus API module documentation.

After saving the changes, reload NGINX to apply the new configuration:

nginx -s reload

Enable NGINX Open Source Stub Status API

To collect basic metrics about server activity for NGINX Open Source, add the following to your NGINX configuration file:

server {
    listen 127.0.0.1:8080;
    location /api {
        stub_status;
        allow 127.0.0.1;
        deny all;
    }
}

This configuration:

  • Enables the stub status API.
  • Allows requests only from 127.0.0.1 (localhost).
  • Blocks all other requests for security.

For more details, see the NGINX Stub Status module documentation.

After saving the changes, reload NGINX to apply the new configuration:

nginx -s reload

Next steps