-
Notifications
You must be signed in to change notification settings - Fork 170
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
Support HTTP Proxy #709
Comments
@3scale/product this is now finished, but without Basic authentication. That requirement is not in JIRA. We probably won't have time to implement that in this release anyway. If we need support for Basic authentication, please open another ticket. |
So this appears to make traffic to the API backed go trough the proxy as well, and that seems weird. Is there a way to use proxy only for the Service Management API and Account Management API? |
@albgus you can use NO_PROXY ENV variable to disable proxy for some (internal/upstream) domains. This is standard way of configuring a proxy server. I don't know any software that would use proxy deliberately just for a subset of outgoing connections. |
There is nothing standard about having a reverse proxy, which directs everything through another proxy, to finally reach the intended API backend. Look in the THREESCALE-221 ticket, and specifically the sidecar proxy workaround. The issue needing solving is when the gateway is deployed into a internal network, and needs to go trough a corporate proxy to reach the internet and talk to the APIs of the 3scale SaaS. I would imagine that everyone in this situation wants the API Gateway to service API Backends that is also located in the internal networks and doesn't need to go trough the proxy. |
@albgus by "configuring a proxy server" I meant configuring any software to use a proxy server. If you don't want to proxy internal connections by a proxy, just set |
@mikz how would you suggest using that variable in a very complex network environment? Hundreds of lines in the autoconfig proxy script used by browsers in the network, with a plethora of rules depending on both your own subnet and the destination subnet. Could such a script be used instead of the NO_PROXY environment variable? (Without having to write the mother of all homegrown unmaintainable scripts to parse the browser config script into a NO_PROXY string) |
@magnusvage Unfortunately I don't have any suggestion. We support only the standard env variables, not the Proxy auto-config (PAC). In server components, it is pretty common to rely just on simple NO_PROXY and whitelist internal domains. The only software I know that supports the PAC are the web browsers. |
So, to further illustrate the point. I imagine that most companies where a proxy is required to reach the internet has a network structure that looks something like this, with the proxy used for reaching 3scale SaaS services.
Now, with the current implementation that API Backend traffic also goes trough the proxy, this happens, and that causes problems.
|
@albgus So how would you make curl work from the DMZ? It is configured through the same env variables. You can just give your API Backend services a proper DNS name such as Even Operating Systems are configured the same way. You enable the proxy for everything and then whitelist what is not going through the proxy. |
If NO_PROXY would accept CIDR notation and not only hostnames, that would be a great leap forward (Yes, of course a proper DNS structure should be set up, but reality isn't always perfect). |
@magnusvage that is a valid requirement and something we should be able to do. But, then you'd have to set up your services as IP addresses, not hostnames. If that is ok we could open an issue for CIDR support in the NO_PROXY. |
Couldn't the client check both hostname and the resolved IP towards the NO_PROXY? If either match, then go direct, otherwise proxy. Similar to your screenshot, NO_PROXY should support both types of entries. In an organisation with a rapidly changing PAC, most of the changes would not affect these parts of the network is my feeling. If a new subdomain or subnet needs to be accessed directly, I would think it is reasonable to have to edit the NO_PROXY. With a little forethought, the overhead should be minimal. |
@magnusvage I believe the setting on the screenshot applies only to IP addresses. So NO_PROXY should support both types, but it does not do resolving before applying the whitelist. Try it for yourself:
It connects to the proxy. The NO_PROXY is applied to the hostname, not to the resolved IP address. I don't see a big deal adding DNS entries for your internal API services under one internal domain. For example |
APIcast should support proxying outgoing HTTP(S) connections through HTTP(S) proxy.
The underlying support is there: ledgetech/lua-resty-http#112
JIRA https://issues.jboss.org/browse/THREESCALE-221
Use Cases
http_proxy
ENV variable should make it use HTTP proxy.Concerns
Using keepalives with HTTPS proxy could require small patch to the lua-resty-http library (ledgetech/lua-resty-http#112 (comment)).
APIcast might need to use
lua-resty-http
instead of native upstream+balancer when using HTTP proxy. Fortunately this could be abstracted away by thehttp_ng
library.The text was updated successfully, but these errors were encountered: