From 956b4f6697b9a2f9146ac251a7bc80f0d2bd9c9f Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sat, 16 Sep 2017 00:45:48 +0100 Subject: [PATCH] Added the ForwardedHeaders middlewear for Reverse Proxy scenarios #865 --- src/Ombi/Startup.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index b2e08a538..073a4274a 100644 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.AspNetCore.SpaServices.Webpack; @@ -194,6 +195,10 @@ namespace Ombi public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMemoryCache cache, IServiceProvider serviceProvider) { + app.UseForwardedHeaders(new ForwardedHeadersOptions + { + ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto + }); var ctx = serviceProvider.GetService(); loggerFactory.AddSerilog();