Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: compatibility with reverse proxy headers (X-Real-IP and/or X-Forwarded-For) #541

Open
erikmd opened this issue Apr 20, 2023 · 0 comments
Assignees
Labels
kind: feature New user-facing feature. priority: high

Comments

@erikmd
Copy link
Member

erikmd commented Apr 20, 2023

Related user(s):

@erikmd

Related issue(s) or PR(s):

No response

Related project scope(s):

web API

The problem:

  • In production environment, learn-ocaml may be combined with a reverse proxy such as nginx or træfik.
  • A resulting issue is that the IP seen by learn-ocaml is always the same (that of the local network)

Wanted solution:

It would be good to:

  • add a flag-or-env-var replacing the incoming IP by that of X-Real-IP, or:
  • add a depth(≥1) flag-or-env-var replacing the incoming IP by the nth last IP in X-Forwarded-For
    (0→X-Real-IP; None→incoming-IP)

Considered alternatives:

No response

Additional context:

See e.g. https://doc.traefik.io/traefik/middlewares/http/ipwhitelist/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New user-facing feature. priority: high
Projects
None yet
Development

No branches or pull requests

1 participant