Skip to content

[Question] Unable to get client IP #224

Description

@duz-sg

I was trying to get client IP with request.client.host, and followed the documentation on https://dockerswarm.rocks/traefik-v1/traefik/#getting-the-client-ip, but it does not seem to work.

From the log, I'm still getting

INFO:uvicorn.access:10.0.5.18:40570 - "GET /api/v1/users/33 HTTP/1.1" 200

The output from logger.info(request.client.host) has the same result 10.0.5.18, this should be the IP traefik assigned internally, not the expected client IP.

Is there anything I'm missing to configure?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions