#Add nginx keys
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Backup current sources
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Add following repositories to `/etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
#Update repositories and install nginx
sudo apt-get update
sudo apt-get install nginx Install latest nginx version on Ubuntu 14.04
We know that sometimes the guys from ubuntu don't update repositories with latest versions of software, so there is quick way to use official nginx repo for installing it.