title: ASP.NET core 2 act as reverse proxy usering rewrite middleware
body: <p>I'm struggling to make my asp.net core 2 app act like a reverse proxy using URL Rewrite rules.</p>
  
  <p>I have the following in my startup.cs:</p>
  
  <pre><code>var rewriteRules = new RewriteOptions()
                  .AddRedirectToHttps();
                  .AddRewrite(@"^POC/(.*)", "http://192.168.7.73:3001/$1", true);
  app.UseRewriter(rewriteRules);
  </code></pre>
  
  <p>The rewrite rule is exactly as it is in my IIS settings (which I'm trying to replace with this method) which works fine.</p>
  
  <p>I'm assuming it has something to do with forwarding the headers maybe? Or maybe I just don't understand how the Rewrite Middleware is supposed to work, if you want the requests to be forwarded instead of just rewritten relative to current hostname.</p>