mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 21:18:13 -05:00
XForwardedFor on self host
This commit is contained in:
parent
3aaaac3c5f
commit
658b47b2fc
@ -18,6 +18,7 @@ using IdentityModel;
|
||||
using IdentityServer4.AccessTokenValidation;
|
||||
using jsreport.AspNetCore;
|
||||
using Bit.Core.IdentityServer;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
|
||||
namespace Bit.Api
|
||||
{
|
||||
@ -173,6 +174,13 @@ namespace Bit.Api
|
||||
// Rate limiting
|
||||
app.UseMiddleware<CustomIpRateLimitMiddleware>();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
{
|
||||
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
|
||||
});
|
||||
}
|
||||
|
||||
// Add static files to the request pipeline.
|
||||
app.UseStaticFiles();
|
||||
|
Loading…
x
Reference in New Issue
Block a user