Fix X-Forwarded-* headers ignored when running in container
This commit is contained in:
parent
30e774da38
commit
8ea0c769d8
@ -34,6 +34,13 @@ if (!dbUpgradeResult.Successful)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
|
{
|
||||||
|
options.ForwardedHeaders = ForwardedHeaders.All;
|
||||||
|
options.KnownNetworks.Clear();
|
||||||
|
options.KnownProxies.Clear();
|
||||||
|
});
|
||||||
|
|
||||||
var dataProtection = builder.Services.AddDataProtection();
|
var dataProtection = builder.Services.AddDataProtection();
|
||||||
if (env.IsProduction())
|
if (env.IsProduction())
|
||||||
{
|
{
|
||||||
@ -86,7 +93,7 @@ builder.Services.AddDbContextPool<AppDbContext>(options => options
|
|||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
app.UseForwardedHeaders(new() { ForwardedHeaders = ForwardedHeaders.All });
|
app.UseForwardedHeaders();
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user