Ubuntu usually ships with an outdated version of nginx. To install the up-to-date version, follow these steps:
sudo -s  
nginx=stable # use nginx=development for the latest development version  
nginx Series Overview
- How To Install the Newest Version of Nginx on Ubuntu
 - How to Run GitLab with Self-Signed SSL Certificate
 - How to Fix Reponse Status 0 (Worker Process Exited on Signal 11)
 - Redirect Only Root URL Path
 - Remove an App/Domain from Sites-Enabled
 - How to Serve a Static HTML Page
 - Is Running but Not Serving Sites
 - How to Fix Unknown "connection_upgrade" Variable
 
By setting nginx=stable you declare a temporary environment variable that defines the nginx version you want to install. Use nginx=stable for the latest stable and nginx=development for the latest development release.
Add the nginx repository to your aptitude repository index.
add-apt-repository ppa:nginx/$nginx  
Now, you're able to install the latest nginx version directly via apt package manager 
apt-get update  
apt-get install nginx  
That's it, your system is running the latest release (stable or development). Lastly, verify the installed version.
nginx -v
# output
nginx version: nginx/1.6.0  
If anything went wrong or you want to install nginx for another operating system (Debian, Red Hat, CentOS, Windows, …), you can get more information within the nginx installation wiki.