mirror of
https://github.com/fergalmoran/Readarr.git
synced 2025-12-26 11:29:25 +00:00
Fixed: Bad login redirect using a reverse proxy
(cherry picked from commit b0f04bb9d79a9f9f0021d179ea7273998be7cab3)
This commit is contained in:
@@ -4,6 +4,7 @@ using DryIoc;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@@ -48,6 +49,13 @@ namespace NzbDrone.Host
|
|||||||
b.AddNLog();
|
b.AddNLog();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
|
{
|
||||||
|
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||||
|
options.KnownNetworks.Clear();
|
||||||
|
options.KnownProxies.Clear();
|
||||||
|
});
|
||||||
|
|
||||||
services.AddRouting(options => options.LowercaseUrls = true);
|
services.AddRouting(options => options.LowercaseUrls = true);
|
||||||
|
|
||||||
services.AddResponseCompression();
|
services.AddResponseCompression();
|
||||||
@@ -146,6 +154,7 @@ namespace NzbDrone.Host
|
|||||||
firewallAdapter.MakeAccessible();
|
firewallAdapter.MakeAccessible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.UseForwardedHeaders();
|
||||||
app.UseMiddleware<LoggingMiddleware>();
|
app.UseMiddleware<LoggingMiddleware>();
|
||||||
app.UsePathBase(new PathString(configFileProvider.UrlBase));
|
app.UsePathBase(new PathString(configFileProvider.UrlBase));
|
||||||
app.UseExceptionHandler(new ExceptionHandlerOptions
|
app.UseExceptionHandler(new ExceptionHandlerOptions
|
||||||
|
|||||||
Reference in New Issue
Block a user