Installing NGINX Plus
Installation (Ubuntu)
NGINX Plus can be installed on the supported versions of Debian or Ubuntu.
- >
Download the SSL certificate, private key, and the JWT license file associated with your NGINX Plus subscription from the MyF5 Customer Portal:
- >Log in to MyF5.
- >Go to My Products & Plans > Subscriptions to see your active subscriptions.
- >Find your NGINX products or services subscription, and select the Subscription ID for details.
- >Download the nginx-repo.crt and nginx-repo.key from the subscription page.
- >Download the JSON Web Token (JWT) from the subscription page.
- >
Create the /etc/ssl/nginx directory:
codesudo mkdir -p /etc/ssl/nginx - >
Copy the downloaded .crt and .key files to the /etc/ssl/nginx/ directory and make sure they are named nginx-repo.crt and nginx-repo.key:
codesudo cp <downloaded-file-name>.crt /etc/ssl/nginx/nginx-repo.crt sudo cp <downloaded-file-name>.key /etc/ssl/nginx/nginx-repo.key - >
Install the prerequisite packages:
codesudo apt update && \ sudo apt install apt-transport-https \ lsb-release \ ca-certificates \ wget \ gnupg2 \ ubuntu-keyring - >
Download and add the NGINX signing key:
codewget -qO - https://cs.nginx.com/static/keys/nginx_signing.key \ | gpg --dearmor \ | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null - >
Add the NGINX Plus repository:
codeprintf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ https://pkgs.nginx.com/plus/ubuntu `lsb_release -cs` nginx-plus\n" \ | sudo tee /etc/apt/sources.list.d/nginx-plus.list - >
Download the nginx-plus apt configuration to /etc/apt/apt.conf.d:
codesudo wget -P /etc/apt/apt.conf.d https://cs.nginx.com/static/files/90pkgs-nginx - >
Update the repository information:
codesudo apt update - >
Install the nginx-plus package. Any older NGINX Plus package is automatically replaced:
codesudo apt install -y nginx-plus - >
Copy the downloaded JWT file to the /etc/nginx/ directory and make sure it is named license.jwt:
codesudo cp <downloaded-file-name>.jwt /etc/nginx/license.jwt - >
Check the
nginxversion to verify that NGINX Plus is installed correctly:codenginx -v
Installation (Docker)
Log in to the private registry using the JWT as the username:
JWT=$(cat <your-license>.jwt)
docker login private-registry.nginx.com --username=$JWT --password=none
curl https://private-registry.nginx.com/v2/nginx-plus/agent/tags/list --key <your-license>.key --cert <your-license>.crt | jq
{
"name": "nginx-plus/agent",
"tags": [
"alpine",
"amzn",
"debian",
"r34-ubi-9",
"r34-ubi",
"r34",
"ubi-9",
"ubi"
]
}
docker pull private-registry.nginx.com/nginx-plus/agent:r34
docker images → there should be the nginx-plus image available.
docker login <my-docker-registry>
docker tag private-registry.nginx.com/nginx-plus/agent:r34 schiz0/nginx-plus:apocalypse
docker push schiz0/nginx-plus:apocalypse
sudo docker run --env=NGINX_LICENSE_JWT=$JWT --restart=always --runtime=runc --name khatra_wala_nginx \
--mount type=bind,source=/var/www/html,target=/usr/share/nginx/html,readonly \
--mount type=bind,source=/etc/nginx/,target=/etc/nginx/ \
-p 6969:80 -d schiz0/nginx-plus:bodacious
nginx CLI
Print help for command-line parameters:
nginx -h
Test the configuration file: NGINX checks the configuration for correct syntax, and then tries to open files referred to in the configuration.
nginx -t
Same as -t, but additionally dumps configuration files to standard output:
nginx -T
Print the NGINX version:
nginx -v
Print the NGINX version, compiler version, and configure parameters:
nginx -V
Send a signal to the master process. The argument signal can be one of:
- >
stop— shut down quickly - >
quit— shut down gracefully - >
reload— reload configuration, start new worker processes with a new configuration, gracefully shut down old worker processes - >
reopen— reopen log files
nginx -s reload
Test the configuration with nginx , dump the full running config with nginx , and reload without dropping connections with nginx -s .