title: Virtual subdomains that forwards to a port with nginx
body: <p>is it possible to create a virtual subdomain with nginx that redirects to a certain port on the same (physical) server?</p>
  
  <p>I have something like this in mind (in /etc/nginx/sites-enabled/default):</p>
  
  <pre><code>server {
      listen 80;
      listen [::]:80;
      server_name subdomain.example.com;
  
      location / {
              proxy_pass http://localhost:25565;
      }
  </code></pre>
  
  <p>}</p>
  
  <p>Unfortunately, that doesnt work. Do I need to actually, statically create A records on the DNS to point to a certain port?</p>