Closed tokers closed 3 years ago
@membphis @spacewander Please take a look when you have time.
We need to patch Nginx to support this feature.
There are two ways:
connection_original_addr
.The second method is more common, what do you think? @spacewander @tokers
If we use a second way, so we have to develop another upstream node setting method to combine the value from the lua ffi call.
We may create another upstream discovery type named passing through. In such a case, APISIX will get endpoints with the original destination.
something does not loads correctly.
something does not loads correctly.
Fixed.
Supported.
In the case of APISIX as the inbound proxy for an application, the destination of traffic sent to APISIX was the application originally (redirected by iptables rules), after APISIX processed the traffic, ran a several plugins, it should be re-sent to the application, so APISIX has to know the original destination address.
Currently, we cannot get the original address and port from the connection fd, we may patch nginx to provide these two variables, like
$connection_original_addr
and$connectino_original_port
, just callgetsockopt
withSO_ORIGINAL_DST
option.After APISIX has this capability, we can inject a new server by apisix-mesh-agent, which at lease has the following configurations.