Open Kralizek opened 7 months ago
I'm getting similar with P6 and configuration file based setup. I get a 502 error and there's also an SSL Certificate error in the logs.
@davidfowl were you able to reproduce the problem detailed in the issue?
@Kralizek I was able to fix this by adding :
"Host": "localhost",
To all of my clusters. It then started working again.
@Kralizek I was able to fix this by adding :
"Host": "localhost",
To all of my clusters. It then started working again.
Adding this solved the issue with the hostname in the link, but I still get a redirect...
builder.Resource.ClusterConfigs[target.Resource.Name] = new()
{
ClusterId = target.Resource.Name,
Destinations = new Dictionary<string, DestinationConfig>
{
[target.Resource.Name] = new() {
Address = $"http://{target.Resource.Name}",
Host = builder.ApplicationBuilder.ExecutionContext.IsRunMode ? "localhost" : default
}
}
};
EDIT: adding the following solved the redirect issue.
var proxyBuilder = builder.Services
.AddReverseProxy()
.ConfigureHttpClient((context, handler) => handler.AllowAutoRedirect = true);
Hi,
The YARP proxy is not forwarding the call to the origins.
I created a repro of the issue here: https://github.com/Kralizek/AspireYarpIssueRepro
The project includes:
The AppHost program file looks like this:
When I run the solution
I get the following on the dashboard
Unfortunately, when I navigate to http://127.0.0.1:63438/weatherforecast (that should be forwarded to https://localhost:7270/weatherforecast) I get redirected to https://api:7270/weatherforecast.
Similarly, when I navigate to http://127.0.0.1:63438/legacy/weatherforecast (that should be forwarded to https://localhost:7018/weatherforecast), I get redirected to https://api:7270/legacy/weatherforecast.
I wasn't able to reproduce the issue with the transformation as explained here. I'll keep investigating on why it doesn't work on my main project.
Thanks for your help!