Skip to content

Not recieving original customer ip in the user.ip tag #554

Closed
getsentry/develop
#119

Description

@jellevanhees

We run the default config from this repository.
our website(vue project) posts client side errors to sentry.
the user.ip tag from these errors is shown as the gateway ip of the docker network the stack runs in.
we would expect the public ip of the client in this tag.
the nginx config is default and uses x-forwarded-for header config.
we already did some testing with SENTRY_USE_X_FORWARDED_FOR = True and SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
with no positive result so far.

we currently have no luck finding related info on the documentation and other github issues are either older then 2 years or don't seem to have a definitive answer.

Activity

  1. self-assigned this
    on Jul 10, 2020
  2. added this to the 20.7.0 milestone on Jul 10, 2020
  3. removed this from the 20.7.0 milestone on Jul 15, 2020
  4. BYK commented on Jul 15, 2020

    @BYK
    Member

    This is unfortunately a bug in Docker itself: moby/moby#15086. The only viable solution seems to be adding an HTTP load balancer in front (or something like CloudFlare) and then modify the nginx config to use the headers they pass down for the real client IP.

    Will keep the issue open so we don't forget to document this.

  5. BYK commented on Jul 15, 2020

    @BYK
    Member

    /ping @mattrobenolt in case he has any other suggestions.

  6. VentyCZ commented on Jul 18, 2020

    @VentyCZ

    I had this issue, just fixed it by updating nginx/nginx.conf file:

    proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    

    Just replaced $remote_addr with $proxy_add_x_forwarded_for.

    If you want the external ip in logs, also update "log_format" line.

  7. added a commit that references this issue on Aug 31, 2020
    ace50be
  8. added a commit that references this issue on Sep 1, 2020
    e60e262
  9. locked and limited conversation to collaborators on Dec 14, 2020
  10. added a commit that references this issue on Jun 8, 2024
    2ed29f3
  11. added a commit that references this issue on Jun 10, 2024
    c9f5b87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions