Make sure you backup your nginx configuration files and have NGINX dependencies installed, if you already installed from source you may skip to step 7.
- Download NGINX Signing Key
wget http://nginx.org/keys/nginx_signing.key
- Run the following command
sudo apt-key add nginx_signing.key
- Edit your sources list and add NGINX repo
sudo nano /etc/apt/sources.list
- Append the following to the end of the file, replace $codename with your Ubuntu version, example xential
deb http://nginx.org/packages/mainline/ubuntu/ $codename nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ $codename nginx
- Run apt update
sudo apt-get update
- Install NGINX dependencies
sudo apt-get build-dep nginx
- Clone this repo
git clone https://github.com/Onyx808/nginx-installer.git
- Switch to root user
su -u root
- cd into nginx-installer folder
cd nginx-installer
- Run the script and when asked enter the nginx version you want to install or upgrade to, example 1.11.13
./nginx.sh
- Add the init script, follow the steps from the url below
https://github.com/Onyx808/nginx-init-script
Use the scripts found in this repository at your own risk. You should always review the contents of these files before putting them to use. Think of them as examples for your inspiration.