title: Nginx showing subdomain's contents as root domain
body: <p>I am running Gitlab on my server with Nginx, and it is running perfectly at git.mysite.com. However, when I access the root domain, instead of showing the index.html file in /usr/share/nginx/www, it's showing Gitlab at /home/gitlab/gitlab.</p>
  
  <p>How can I fix this?</p>
  
  <p>default (/etc/nginx/sites-available/default)</p>
  
  <pre><code>server {
      listen   80; ## listen for ipv4; this line is default and implied
      #listen   [::]:80 default ipv6only=on; ## listen for ipv6
  
      root /usr/share/nginx/www;
      index index.php index.html index.htm;
  
      server_name mysite.com;
  
      location / {
          try_files $uri $uri/ /index.html;
      }
  
      location /doc/ {
          alias /usr/share/doc/;
          autoindex on;
          allow 127.0.0.1;
          deny all;
      }
  
      error_page 500 502 503 504 /50x.html;
      location = /50x.html {
          root /usr/share/nginx/www;
      }
  
      location ~ \.php$ {
          fastcgi_pass 127.0.0.1:9000;
          fastcgi_index index.php;
          include fastcgi_params;
      }
      location ~ /\.ht {
          deny all;
      }
  }
  </code></pre>
  
  <p>gitlab (/etc/nginx/sites-available/gitlab)</p>
  
  <pre><code>upstream gitlab {
    server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
  }
  
  server {
    listen 198.199.70.76:80 default_server;
    server_name git.mysite.com;
    root /home/git/gitlab/public;
  
    # individual nginx logs for this gitlab vhost
    access_log  /var/log/nginx/gitlab_access.log;
    error_log   /var/log/nginx/gitlab_error.log;
  
    location / {
      # serve static files from defined root folder;.
      # @gitlab is a named location for the upstream fallback, see below
      try_files $uri $uri/index.html $uri.html @gitlab;
    }
  
    # if a file, which is not found in the root folder is requested,
    # then the proxy pass the request to the upsteam (gitlab unicorn)
    location @gitlab {
      proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
      proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
      proxy_redirect     off;
  
      proxy_set_header   X-Forwarded-Proto $scheme;
      proxy_set_header   Host              $http_host;
      proxy_set_header   X-Real-IP         $remote_addr;
  
      proxy_pass http://gitlab;
    }
  }
  </code></pre>