For more up-to-date Nginx versions, it is a good idea to add official Nginx package source URLs.
As Nginx releases are signed using PGP you need to download
its PGP key and then add it to apt.
wget http://nginx.org/keys/nginx_signing.keyapt-key add nginx_signing.keyAppend to /etc/apt/source.list the appropriate package source URL
depending on your OS version, e.g. for Trusty
deb http://nginx.org/packages/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/ubuntu/ trusty nginxFinally, install Nginx.
apt-get install nginx