Skip to content

feat(real-ip): implement the first version#4813

Merged
spacewander merged 3 commits into
apache:masterfrom
spacewander:realip
Aug 13, 2021
Merged

feat(real-ip): implement the first version#4813
spacewander merged 3 commits into
apache:masterfrom
spacewander:realip

Conversation

@spacewander

Copy link
Copy Markdown
Member

Signed-off-by: spacewander [email protected]

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@spacewander
spacewander marked this pull request as ready for review August 12, 2021 09:41

| Name | Type | Requirement | Default | Valid | Description |
| --------- | ------------- | ----------- | ---------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| source | string | required | | Any Nginx variable like `arg_realip` or `http_x_forwarded_for`| dynamically set the client's IP and port in APISIX's view, according to the value of variable. If the value doesn't contain a port, the client's port won't be changed. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may also hint to the users that if the address format is not correct, the real-ip plugin will just let it go and don't change the client address.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in the new commit

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in the new commit

Signed-off-by: spacewander <[email protected]>
Comment thread docs/en/latest/plugins/real-ip.md Outdated

It works like Nginx's `ngx_http_realip_module`, but is more flexible.

This plugin requires APISIX to run on [APISIX-OpenResty](../how-to-build.md#step-6-build-openresty-for-apache-apisix).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a note is better

Signed-off-by: spacewander <[email protected]>
@spacewander
spacewander merged commit 03f0912 into apache:master Aug 13, 2021
@spacewander
spacewander deleted the realip branch August 13, 2021 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants