title: Nginx running in WSL2 (Ubuntu 20.04) does not serve HTML page to Windows 10 host on another port than port 80
body: <p>I am new to WSL2 but so far it works really nice.
  I have a simple HTML Page i want to serve with Nginx, but i want it to access with a web browser on the host. The default nginx webpage works(!), so i started to mimic the default nginx html page (/var/www/html/index.html). </p>
  
  <p>I have created:<br>
  /var/www/test.dev/index.html<br>
  /etc/nginx/sites-available/test.dev (+Symlink in sites-enabled/)  </p>
  
  <p>Nginx config:</p>
  
  <pre><code>server {
      listen 9000;
      listen [::]:9000;
  
      server_name test.dev;
  
      root /var/www/test.dev;
      index index.html;
  
      location / {
              try_files $uri $uri/ =404;
      }
  }
  </code></pre>
  
  <p>So the only big difference to the default config is the port 9000.</p>
  
  <p>I reloaded/restarted nginx and i tried to curl my configs:</p>
  
  <pre><code>$ curl https://localhost
  
  $ curl https://localhost:9000
  </code></pre>
  
  <p>both requests were <em>successful</em>.</p>
  
  <p>But now i want to access the pages on my Windows host with a web browser.
  The first one (default) works and i can see the default Nginx HTML page.
  The second one does not work: <em>site can't be reached</em>.</p>
  
  <p>So my questions:<br>
   1. Why is that? Do i have to make some changes to the Windows Firewall settings?<br>
   2. I like to have a virtual host name like example.com instead of localhost:9000<br>
      I've edited /etc/hosts... it works with curl but again not in the host Browser</p>