Skip to content

How to use ProxyFix with klein? #723

Open
@laf0rge

Description

I'm running a klein based app behind a [nginx] reverse proxy which sets the various X-Real-IP, X-Forwarded-* headers. Klein doesn't automaticall seem to pick up on those, as the client IP logged is always the IP of the reverse proxy.

I saw there is https://werkzeug.palletsprojects.com/en/2.3.x/middleware/proxy_fix/ available for werkzeug, but I was unable to figure out how to use it. if I say something like

app = ProxyFix(my_klein_app, x_for=1, x_host=1)
app.run()

then the proxyFix of course doesn't offer the same run method like Klein.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions