mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
【新增】增加获取用户真实ip地址中间件【RealIpMiddleware】,防止Nginx转发后只能获取服务器ip的问题。
This commit is contained in:
@@ -158,6 +158,8 @@ app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||
#endregion
|
||||
|
||||
#region 中间件注册===================================================================
|
||||
// 获取用户访问真实ip
|
||||
app.RealIpMiddleware();
|
||||
// 启用并发限制数中间件
|
||||
app.UseConcurrencyLimiter();
|
||||
// 开启Ip限流
|
||||
@@ -168,6 +170,7 @@ app.UseRequestResponseLog();
|
||||
app.UseRecordAccessLogsMildd(GlobalEnumVars.CoreShopSystemCategory.Admin.ToString());
|
||||
// 记录ip请求 (注意开启权限,不然本地无法写入)
|
||||
app.UseIpLogMildd();
|
||||
|
||||
#endregion
|
||||
|
||||
app.UseSwagger().UseSwaggerUI(c =>
|
||||
|
||||
Reference in New Issue
Block a user