fix(#IWUSU): nginx 代理模式下获取真实IP

#Comment
comment #IWUSU

#Issue
close https://gitee.com/LongbowEnterprise/dashboard/issues?id=IWUSU
This commit is contained in:
Argo Zhang 2019-05-22 12:16:36 +08:00
parent 16ec57577b
commit 42146655a5
1 changed files with 2 additions and 0 deletions

View File

@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Versioning;
using Microsoft.Extensions.Configuration;
@ -116,6 +117,7 @@ namespace Bootstrap.Admin
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseForwardedHeaders(new ForwardedHeadersOptions() { ForwardedHeaders = ForwardedHeaders.All });
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();