title: Configure Nginx with a Subdomain
body: <p>I've done my prior research, but cannot seem to find how to properly configure nginx to accept a subdomain.</p>
  
  <p>I currently have it properly configured for mydomain.com, but not analytix.mydomain.com:</p>
  
  <pre><code>server {
          listen       80;
          server_name     *.mydomain.com;
          access_log /home/ubuntu/virtualenv/mydomain/error/access.log;
          error_log /home/ubuntu/virtualenv/mydomain/error/error.log warn;
          connection_pool_size 2048;
  
          fastcgi_buffer_size 4K;
          fastcgi_buffers 64 4k;
  
          root /home/ubuntu/virtualenv/mydomain/homelaunch/;
  
          location /static/ {
              alias /home/ubuntu/virtualenv/mydomain/homelaunch/static/;
          }
  
          location / {
              proxy_pass http://127.0.0.1:8001;
              proxy_set_header Host $host;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
          }
      }
  </code></pre>
  
  <p>the <code>server_name</code> declaration is accepting <code>&lt;anythinghere&gt;.mydomain.com</code> which is good. </p>
  
  <p>If I access <code>analytix.mydomain.com</code> , it throws a Http 500 default which is fine, because its throwing it from the existing application at <code>mydomain.com</code></p>
  
  <p>The domain is already propogated to this server I'm trying to access it on.</p>
  
  <p>How can I designate a folder, at a path, to house the contents for <code>analytix.mydomain.com</code> ? I would assume i would require changing an attribute in the nginx conf (as shown above)</p>