Open Closed

Get wrong client IP Address running on docker #3387


User avatar
0
isaac.yip@cpy.com.hk created
  • 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?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Blazor wasm or Blazor server?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    isaac.yip@cpy.com.hk created

    Blazor server

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    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/

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    scottie.tang@cpy.com.hk created

    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    https://github.com/dotnet/AspNetCore.Docs/issues/21615#issuecomment-786311147

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 09, 2026, 11:56
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.