mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 08:19:38 +02:00
Fixed: Bad login redirect using a reverse proxy
(cherry picked from commit b0f04bb9d79a9f9f0021d179ea7273998be7cab3) (cherry picked from commit ee81ad2add4819920e17ab8b64165a8131ae8dd0)
This commit is contained in:
parent
147cfe538a
commit
4b06f6b506
@ -3,6 +3,7 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@ -48,6 +49,13 @@ public void ConfigureServices(IServiceCollection services)
|
||||
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.AddResponseCompression();
|
||||
@ -144,6 +152,7 @@ public void Configure(IApplicationBuilder app,
|
||||
firewallAdapter.MakeAccessible();
|
||||
}
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
app.UseMiddleware<LoggingMiddleware>();
|
||||
app.UsePathBase(new PathString(configFileProvider.UrlBase));
|
||||
app.UseExceptionHandler(new ExceptionHandlerOptions
|
||||
|
Loading…
Reference in New Issue
Block a user