Open yu-sun-77 opened 3 years ago
cc @htuch @yanavlasov
I don't think there's a native way to do this, but seems like an useful enhancement.
I think building on dynamic forward proxy here makes sense; you essentially rewrite the host in some HTTP filter and rely on dynamic forward for the rest.
Hi. I would like to give a try. At first glance it seems like I have to enhance the host rewrite specifier API and add corresponding logic to handle it in HTTP dynamic forward proxy filter - https://github.com/envoyproxy/envoy/blob/747944b30b5556b07a5bffdea46fcea89404b9f4/api/envoy/extensions/filters/http/dynamic_forward_proxy/v3/dynamic_forward_proxy.proto#L37-L62
Sorry. Due to some reasons, I could not take this up for at least a month. Other priorities. So stepping back.
@yu-sun-77 I understand the need for this feature, but I have one question. Why doesn't LuaPerRoute
host rewriting work here? This may be achieved by the following steps.
@Shikugawa Can you provide an example with lua filter?
My use case is that I will receive tcp traffic on my envoy which was resulted as a part of iptable redirect. the original request was meant for 10.10.10.10:9300, the iptable redirect it to envoy and envoy is supposed to forward the request to 10.10.10.10:9393. Basically changing the upstream port. is it possible?
Allowing metadata expressions in host_rewrite_literal
(or new host_rewrite_value
) in combination with header_to_metadata should make it work, right?
@Shikugawa , doesn't Lua require buffering of whole request before it can rewrite request headers?
If you are reporting any crash or any potential security issue, do not open an issue in this repo. Please report the issue via emailing envoy-security@googlegroups.com where the issue will be triaged appropriately.
Description:
I've walked through Envoy docs and found dynamic forward proxy and Lua filter might be helpful, but still wanna know how will Envoy support fetch value from host/header and dynamically define as a variable?
Any suggestion is appreciated. Thanks.
[optional Relevant Links:]