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

Add %ORIGINAL_DST% as a header variable #2484

Closed
mandarjog opened this issue Jan 30, 2018 · 2 comments · Fixed by #2487
Closed

Add %ORIGINAL_DST% as a header variable #2484

mandarjog opened this issue Jan 30, 2018 · 2 comments · Fixed by #2487
Assignees
Labels
beginner Good starter issues! enhancement Feature requests. Not bugs or questions. help wanted Needs help!

Comments

@mandarjog
Copy link
Contributor

Add %ORIGINAL_DST% as a header variable

Description:
When the original destination ip as resolved by the client is disregarded by the local proxy, it may still be relevant to an upstream.

This enables configuration like

request_headers_to_add:
- key: x-original-destination
  value: %ORIGINAL_DST%

For reference istio via directive: https://docs.google.com/document/d/1BGi18QnpqceEMzGAPWlzOTvlu65QRvbiWtyWK9jtddU/edit#heading=h.ouc0ih1n6vge

@mattklein123 mattklein123 added enhancement Feature requests. Not bugs or questions. help wanted Needs help! beginner Good starter issues! labels Jan 30, 2018
@mandarjog
Copy link
Contributor Author

I would like to take a crack at this.

common/filter/listener/original_dst.cc## OriginalDst::onAccept recovers the original dest address and stores it using socket.setLocalAddress(addr, true)
This is available as request_info.downstreamLocalAddress()

Will this only be the original destination if the original_dst listener is used? That is the only place I see this being recovered.

@rshriram
Copy link
Member

Scrolling through Envoy users, I stumbled upon this: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host (thanks to @9len)

Shikugawa pushed a commit to Shikugawa/envoy that referenced this issue Mar 28, 2020
jpsim pushed a commit that referenced this issue Nov 28, 2022
The old style will stop working in Bazel 6.0 (see bazelbuild/bazel@3469784)

Signed-off-by: Benjamin Peterson <[email protected]>
Signed-off-by: JP Simard <[email protected]>
jpsim pushed a commit that referenced this issue Nov 29, 2022
The old style will stop working in Bazel 6.0 (see bazelbuild/bazel@3469784)

Signed-off-by: Benjamin Peterson <[email protected]>
Signed-off-by: JP Simard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner Good starter issues! enhancement Feature requests. Not bugs or questions. help wanted Needs help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants