title: IIS 10 rewrite to internal port for both http and https
body: <p>I have a node js application running on the port <code>8080</code> in my Windows server and is accessible from inside of the server by <code>http://localhost:8080</code>. I want to use some subdomains like <code>app.mydomain.com</code> without using the port number from outside of the server to open this node.js application. I want to completely all traffics be rewrited to this port and there is no filters for subdirectories.</p>
  <p>I've installed <code>ARRv3_0</code> and <code>urlrewrite2</code> on my IIS and also restarted the server too. Also installed a certificate on the server and assigned to this IIS website. Currently, I'm using this file as my <code>web.config</code>:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;configuration&gt;
      &lt;system.webServer&gt;
          &lt;rewrite&gt;
              &lt;rules&gt;
                  &lt;rule name=&quot;Reverse Proxy to node server&quot; stopProcessing=&quot;true&quot;&gt;
                      &lt;match url=&quot;(.*)&quot; /&gt;
                      &lt;action type=&quot;Rewrite&quot; url=&quot;http://localhost:8080/{R:1}&quot; /&gt;
                  &lt;/rule&gt;              
              &lt;/rules&gt;
          &lt;/rewrite&gt;
      &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>Also, I created an index.html file in the website directory too, but there is no difference.</p>
  <p><a href="https://i.stack.imgur.com/HrMZZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HrMZZ.png" alt="enter image description here" /></a></p>
  <p>I get 404 when I open the domain with both <code>http</code> and <code>https</code>.</p>
  <p><a href="https://i.stack.imgur.com/trd9z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/trd9z.png" alt="enter image description here" /></a></p>