Closed AmerDwight closed 11 months ago
This is a common use case, but unfortunately, APISIX doesn't have an answer here. The reason is APISIX being based on nginx and nginx doesn't support proxies for upstreams, and also doesn't have plans to support it. Unlike curl, wget and some other tools.
There are tricks that can be done on the network level, like setting up a transparent proxy, or using some third-party utility like redsocks2 or similar, but it's definitively more involved.
I would definitively like to see an official doc how to set up a Linux or Docker VM with proxy support, or even a packed docker compose which works out of the box. I think this use case is pretty common for an API Gateway, and every commercial API Gateway that I can think of has an easy way to configure http_proxy or https_proxy on a gateway or endpoint level.
@markokocic Yeah, I found that the mechanism was to find the address of upstreams while initializing, in order to achieve a static reference. Thanks for your reply and hints provided.
Description
In my case, the upstream server is hosted in other net, which is separated from net of APISIX The way to connect is probably go thru with middle-proxy, like:
So, I set middle-proxy info in environment, ( Docker image: apisix:3.2.2-centos ) and testify the middle-proxy by curl command, which is doing fine.
But if I build in route of APISIX, it goes 503 response. I don't know why APISIX did not sent requests follow the middle-proxy setting in environment
upstream:
routes:
CentOS proxy-set: /etc/bashrc
Environment
apisix version
): apisix:3.2.2-centosuname -a
): Docker - centosopenresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
): bitnami/etcd:3.5luarocks --version
):