-
Notifications
You must be signed in to change notification settings - Fork 65
AddProxySupport on .NET Framework not working with UseForwardedHeaders #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, the virtual path needs to be the same for this set up to work. Otherwise things like routing just don't work well. I'm happy to hear if someone is able to make it work, but I've gone down that rabbit hole and am fairly convinced that the path of the application needs to be the same. I'm going to leave this open so we can ensure this is documented. |
@twsouthwick thanks for the response! Is this the recommended structure? When I open /devCore, my site is still displaying /dev 😢 |
@gumbarros I'm not an IIS expert, so I may not be interpreting that screenshot fully - please correct me if my understanding here is wrong. It appears that you have dev and devCore as separate applications within the same site. Instead, you'll want to set it up so that they are on different sites. They can still have the same virtual directory/application structure, but the names of those must match. |
@twsouthwick thank you very much! Solved my problem. For anyone with difficulties: "ReverseProxy": {
"Routes": {
"fallbackRoute": {
"ClusterId": "fallbackCluster",
"Order": "1",
"Match": {
"Path": "{**catch-all}"
}
}
},
"Clusters": {
"fallbackCluster": {
"Destinations": {
"fallbackApp": {
"Address": "http://localhost:8088/dev/"
}
}
}
}
} .NET Core app now reverse proxy to the .NET Framework localhost. /// <summary>
/// Captura a URL base do sistema
/// </summary>
/// <returns>URL</returns>
/// <remarks>Lucio Pelinson 11-02-2009 / Gustavo Barros 24-08-2022</remarks>
public static string PATH
{
get
{
var request = HttpContext.Current.Request;
var helper = new UrlHelper(request.RequestContext);
return helper.Content("~");
}
} Congratulations to everyone on this project, everything working like a charm. |
Describe the bug
As described in this issue , UseForwardedHeaders is not working, my website is displaying the subroute instead of the original request. I don't know if this is a SystemWebAdapter issue or YARP issue, please close this issue if it is 100% YARP related.
To Reproduce
Host in IIS a .NET Core website on www.site.com
Host in IIS a .NET Framework website on www.site.com/subapplication
Create a simple /Login route on .NET Framework website.
Add to .NET Framework website global.asax.vb:
Go to www.site.com
Expected:
www.site.com/Login
Actual:
www.site.com/subapplication/Login
Technical Info
ASP.NET Framework Application:
ASP.NET Core Application:
Why this is a migration problem
Because we have 100+ references using this getter:
This causes many hyperlinks created with this getter to wrongly redirect only to the .NET Framework site instead of the Core one, but it don't happen when we use www.site.com/Login, only when we use www.site.com/subapplication/Login.
The text was updated successfully, but these errors were encountered: