- If you already have old NGINX packages in your system, back up your configs and logs:
- sudo cp -a /etc/nginx /etc/nginx-plus-backup
- sudo cp -a /var/log/nginx /var/log/nginx-plus-backup
- Create the /etc/ssl/nginx/ directory:
- sudo mkdir -p /etc/ssl/nginx
- Log in to MyF5, if you purchased subscription, or follow the link in the trial activation email, and download the following two files:
- nginx-repo.key
- nginx-repo.crt
- Install prerequisite packages:
- sudo yum install ca-certificates
- Copy the above two files to the Amazon Linux server into
/etc/ssl/nginx/
directory. Use your SCP client or other secure file transfer tools. - Add NGINX Plus repository by downloading the file nginx-plus-amazon2.repo to /etc/yum.repos.d:
- sudo wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/nginx-plus-amazon2.repo
- If you have modsecurity subscription, add modsecurity repository by downloading the file modsecurity-amazon2.repo to /etc/yum.repos.d:
- sudo wget -P /etc/yum.repos.d https://cs.nginx.com/static/files/modsecurity-amazon2.repo
- Install the NGINX Plus package
- sudo yum install nginx-plus
- Install modsecurity, if you have modsecurity subscription
- sudo yum install nginx-plus nginx-plus-module-modsecurity
- Check the
nginx
binary version to ensure that you have NGINX Plus installed correctly: - nginx -v
- baseurl=https://pkgs.nginx.com/plus/Rxx/amzn2/$releasever/$basearch
Upgrading to a specific release
In order to upgrade from the previous version of nginx-plus, run sudo yum upgrade nginx-plus
Default repository path is configured to point to the latest NGINX Plus release with an ability to downgrade to one of the previous releases issued within 2 years. If you want to stick to the particular release, you should modify the baseurl
parameter in the nginx-plus-amazon.repo
file in a following way:
where xx
is a release number.
Make the same changes to the modsecurity-amazon.repo
file, if you have appropriate subscription.