Download the NGINX Plus Cert and Key Bundle

Overview

This topic explains how to use the NGINX Controller REST API to download your NGINX Plus nginx.crt and nginx.key files. You’ll need these files if you’re installing NGINX Plus as part of an NGINX Controller trial.

 

Authenticate with the NGINX Controller API

The NGINX Controller API uses session cookies to authenticate requests. The session cookie is returned in response to a GET /api/v1/platform/login request. See the Login endpoint in the NGINX Controller API Reference documentation for information about session cookie timeouts and invalidation.

Tip:
You can send a GET request to the login endpoint to find the status of the session token.

For example:

  • Login and capture the session cookie:

    curl -c cookie.txt -X POST --url 'https://198.51.100.10/api/v1/platform/login' --header 'Content-Type: application/json' --data '{"credentials": {"type": "BASIC","username": "[email protected]","password": "Towel$123"}}'
    
  • Use the session cookie to authenticate and get the session status:

    curl -b cookie.txt -c cookie.txt -X GET --url 'https://198.51.100.10/api/v1/platform/login'
    

 


Download the NGINX Plus Certificate and Key Bundle

To use the NGINX Controller REST API to download your NGINX Plus certificate and key bundle as a gzip or JSON file, send a GET request to the /platform/licenses/nginx-plus-licenses/controller-provided endpoint.

For example:

curl -b cookie.txt -c cookie.txt -X GET --url 'https://192.0.2.0/api/v1/platform/licenses/nginx-plus-licenses/controller-provided' --output nginx-plus-certs.gz

What’s Next

 


This documentation applies to the following versions of NGINX Controller Documentation: 3.10, 3.11, 3.12, 3.13, 3.14, 3.15 and 3.16.