- ABP Framework version: v5.3.0
- UI type: Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
I am running microservice on docker with a bridge network. Using HttpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString(), and it return the bridge gateway.
How to get the correct client ip address?
5 Answer(s)
-
0
hi
Blazor wasm or Blazor server?
-
0
Blazor server
-
0
hi
You can try to configure the forwarding header.
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-6.0 https://blog.sinenie.cl/blog/forwarded-headers/
-
0
Hi thanks, we are able to create a reversed proxy and add real IP to the request headers. We can retrieve the visitor IP address from those headers, however we want to know is there anything we need to apply/implement in abp modules in order to let us get remote ip via context.RemoteIpAddress ?
Thanks.
-
0
hi
https://github.com/dotnet/AspNetCore.Docs/issues/21615#issuecomment-786311147