mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-31 01:08:41 +00:00
Add KnownProxies in appsettings for load balancers/docker
This commit is contained in:
parent
017dcd6888
commit
78dd5b6489
2 changed files with 12 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Globalization;
|
||||
using System.Net;
|
||||
using LBPUnion.ProjectLighthouse.Database;
|
||||
using LBPUnion.ProjectLighthouse.Localization;
|
||||
using LBPUnion.ProjectLighthouse.Middlewares;
|
||||
|
@ -48,6 +49,11 @@ public class WebsiteStartup
|
|||
options =>
|
||||
{
|
||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
foreach (KeyValuePair<string, string?> proxy in this.Configuration.GetSection("KnownProxies").AsEnumerable())
|
||||
{
|
||||
if (proxy.Value == null) continue;
|
||||
options.KnownProxies.Add(IPAddress.Parse(proxy.Value));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue