Skip to content

azure front door x-forwaded-for #2803

Description

@pankajmyt

our api runs behind frontdoor .

https://echo.labstack.com/docs/ip-address

this picks right most. however azure frontdoor is inverse of it.

can you provide an option to pick from left/right depending on config.

Activity

  1. FrancoTampieri commented on Jul 22, 2025

    @FrancoTampieri

    My 2 cents:

    Would be better if u provide a sample, to have a case. For example I didn't have experience with Azure platforms so I don't know how frontdoor works.

    Regards

  2. pankajmyt commented on Jul 22, 2025

    @pankajmyt
    Author

    So echo ip address picks right most ip. whereas azure,
    does clientip, proxy1 ip, internal container app env.
    so if I use the xff extractor it gives proxy2 ip.

    where as if you see
    https://expressjs.com/en/guide/behind-proxies.html

    this picks left most ip, so works

  3. aldas commented on Jul 23, 2025

    @aldas
    Contributor

    you could create custom IPExtrator

    echo/ip.go

    Line 213 in 98ca08e

    type IPExtractor func(*http.Request) string
    and set to echo.IPExtractor

    echo/echo.go

    Line 99 in 98ca08e

    IPExtractor IPExtractor

  4. pankajmyt commented on Jul 24, 2025

    @pankajmyt
    Author

    I have, but if xff extractor could support trusting from left/right. that will be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions