title: Port fowarding for Nginx using Vagrant
body: <p>I'm facing an issue:
  I'm using Windows 7 and running a Vagrant Box (Lucid32), and inside it, a Nginx Server. </p>
  
  <p>If i run </p>
  
  <pre><code>$ curl localhost:80 
  </code></pre>
  
  <p>I can see the Nginx's welcome page perfectly.</p>
  
  <p>However, in Windows, the port 2000 (the fowarding I've made) <strong>can't reach a thing.</strong></p>
  
  <p>Otherwise, if I run the rails server, I can reach it, outside the VM.</p>
  
  <p>I made this basic configuration for the nginx.conf:</p>
  
  <pre><code>server{
    listen 8080;
    server_name localhost;  
    access_log /usr/local/nginx/logs/access.log;
    access_log /usr/local/nginx/logs/error.log;
    location /{
      root /var/www;
      index index.html index.html;
    }
  
  }
  </code></pre>
  
  <p>My vagrantfile:</p>
  
  <pre><code>VAGRANTFILE_API_VERSION = "2"
  
  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.box = "lucid32"
  
    config.vm.network :forwarded_port, guest: 3000, host: 3000    # rails
    #config.vm.network :forwarded_port, guest: 3306, host: 3306    # mysql
    config.vm.network :forwarded_port, guest: 2000, host: 80  # apache/nginx  
  end
  </code></pre>
  
  <p>Output by vagrant up command:</p>
  
  <pre><code>Bringing machine 'default' up with 'virtualbox' provider...
  [default] Clearing any previously set forwarded ports...
  [default] Fixed port collision for 2000 =&gt; 80. Now on port 2200.
  [default] Creating shared folders metadata...
  [default] Clearing any previously set network interfaces...
  [default] Preparing network interfaces based on configuration...
  [default] Forwarding ports...
  [default] -- 22 =&gt; 2222 (adapter 1)
  [default] -- 3000 =&gt; 3000 (adapter 1)
  [default] -- 2000 =&gt; 8080 (adapter 1)
  [default] -- 2000 =&gt; 2200 (adapter 1)
  [default] Booting VM...
  [default] Waiting for machine to boot. This may take a few minutes...
  [default] Machine booted and ready!
  [default] The guest additions on this VM do not match the installed version of
  VirtualBox! In most cases this is fine, but in rare cases it can
  cause things such as shared folders to not work properly. If you see
  shared folder errors, please update the guest additions within the
  virtual machine and reload your VM.
  
  Guest Additions Version: 4.2.0
  VirtualBox Version: 4.3
  [default] Mounting shared folders...
  [default] -- /vagrant
  </code></pre>
  
  <p>Thanks!</p>