title: Update nginx in ubuntu 14.04
body: <p>In my server, <code>nginx -v</code> returns <code>nginx version: nginx/1.4.6 (Ubuntu)</code>, it is very old, so I decided to update it to the latest stable version.</p>
  
  <p>Then, I followed <a href="https://www.digitalocean.com/community/questions/update-nginx-without-loosing-configuration" rel="noreferrer">this answer</a>:</p>
  
  <pre><code>sudo apt-get update
  sudo apt-get install nginx
  </code></pre>
  
  <p>It gives:</p>
  
  <pre><code>Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  The following extra packages will be installed:
    nginx-common nginx-core
  Suggested packages:
    fcgiwrap nginx-doc
  The following packages will be upgraded:
    nginx nginx-common nginx-core
  3 upgraded, 0 newly installed, 0 to remove and 311 not upgraded.
  Need to get 349 kB of archives.
  After this operation, 3,072 B of additional disk space will be used.
  Do you want to continue? [Y/n] 
  Get:1 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main nginx-common all 1.4.6-1ubuntu3.7 [19.0 kB]
  Get:2 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main nginx all 1.4.6-1ubuntu3.7 [5,352 B]
  Get:3 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main nginx-core amd64 1.4.6-1ubuntu3.7 [325 kB]
  Fetched 349 kB in 0s (431 kB/s)
  Preconfiguring packages ...
  (Reading database ... 111751 files and directories currently installed.)
  Preparing to unpack .../nginx-common_1.4.6-1ubuntu3.7_all.deb ...
  Unpacking nginx-common (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
  Preparing to unpack .../nginx_1.4.6-1ubuntu3.7_all.deb ...
  Unpacking nginx (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
  Preparing to unpack .../nginx-core_1.4.6-1ubuntu3.7_amd64.deb ...
  Unpacking nginx-core (1.4.6-1ubuntu3.7) over (1.4.6-1ubuntu3.5) ...
  Processing triggers for ufw (0.34~rc-0ubuntu2) ...
  Processing triggers for ureadahead (0.100.0-16) ...
  Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
  Setting up nginx-common (1.4.6-1ubuntu3.7) ...
  Setting up nginx-core (1.4.6-1ubuntu3.7) ...
  Setting up nginx (1.4.6-1ubuntu3.7) ...
  </code></pre>
  
  <p>However, <code>nginx -v</code> still returns <code>nginx version: nginx/1.4.6 (Ubuntu)</code>.</p>
  
  <p>Does anyone know a safe way to update nginx, without modifying configuration files? Because it is in the server in production, I would like to be very careful...</p>