Open Closed

Reverse Proxy Handling #1239


0
acrigney created

Hi Guys, Love your work but we are unable to get our Azure reverse proxy setup to work. Its not a problem with ASP.NET Boilerplate its just a general MVC question. I just thought you could help us out 8-)

We have a root site xxx and the reverse proxy should redirect xxx/test to our real site <a class="postlink" href="http://blah.blah.azurewebsites.net">http://blah.blah.azurewebsites.net</a>

We have tried the fixes referenced here.

1 Fix for this now added to my AspNetBundling NuGet package which resolves a bunch of other issues in the standard transformer, particularly around using data-uris. Open-sourced on GitHub too.

Just do: 1.1 Install-Package AspNetBundling 1.2. Replace CssRewriteUrlTransform with CssRewriteUrlTransformFixed

  1. Using this CssRewriteUrlTransformWrapper public class CssRewriteUrlTransformWrapper : IItemTransform {
    public string Process(string includedVirtualPath, string input) { return new CssRewriteUrlTransform().Process("~" + VirtualPathUtility.ToAbsolute(includedVirtualPath), input); } }
  2. Using ResolveBundleUrl e.g with code like this <link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/content/styles/css")" rel="stylesheet" type="text/css" />

Here is our route rule in our root web.config file for our root site in Azure. NB. This site only has a web.config configured.

<rule name="test" stopProcessing="true"> <match url="^test/?(.*)" /> <action type="Rewrite" url="http://blah.blah.azurewebsites.net/{R:1}" /> </rule> But all of our scripts and js bundles give 404 not found errors.

It would be really awesome if you could give us any advice, we have Microsoft working on it!!

Best Regards, Alistair


No answer yet!