How do I use Sovereign to reverse proxy a site in .NET MVC?

  • Page Owner: Not Set
  • Last Reviewed: 2021-06-17

I'd like to reverse proxy a site into my .NET MVC Site, how can I do that?


Answer

WIP Answer

Using Blend.Sovereign and OWIN

Create a startup class and reference this example

  app.StartsWith("/blog", (blog) =>
  {
      blog.UseProxy("togetherweplay.playlsi.com", "https", config =>
      {
          config.RewriteUri = (uri) =>
          {
              var newUri = new UriBuilder("https", "togetherweplay.playlsi.com", 443, uri.Path.Substring("/blog".Length));
              return newUri;
          };
          config.ContentProcessors.AddRewriteString("text/html", (context, html) =>
          {
              return html.Replace("togetherweplay.playlsi.com", "localhost:52172");
          });
          config.CacheOptions.CacheMode = CacheMode.None;
      });
  });