Add forwarded headers
All checks were successful
Build, Push and Run Container / build (push) Successful in 29s
All checks were successful
Build, Push and Run Container / build (push) Successful in 29s
This commit is contained in:
@@ -39,6 +39,20 @@ builder.Services.AddHttpClient().AddHttpClient("InsecureClient")
|
||||
HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
|
||||
});
|
||||
|
||||
// If you know your proxy IP(s), specify them for security.
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders =
|
||||
ForwardedHeaders.XForwardedFor |
|
||||
ForwardedHeaders.XForwardedProto |
|
||||
ForwardedHeaders.XForwardedHost;
|
||||
|
||||
// Trust specific proxy or network:
|
||||
options.KnownProxies.Clear();
|
||||
options.KnownNetworks.Clear();
|
||||
options.ForwardLimit = null; // but prefer being explicit when possible
|
||||
});
|
||||
|
||||
builder.Services
|
||||
.AddAuthentication(o =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user