How can I configure proxy settings for applications that do not respect http_proxy and no_proxy env vars

Posted on

How can I configure proxy settings for applications that do not respect http_proxy and no_proxy env vars – A server stack is the collection of software that forms the operational infrastructure on a given machine. In a computing context, a stack is an ordered pile. A server stack is one type of solution stack — an ordered selection of software that makes it possible to complete a particular task. Like in this post about How can I configure proxy settings for applications that do not respect http_proxy and no_proxy env vars was one problem in server stack that need for a solution. Below are some tips in manage your linux server when you find problem about linux, iptables, routing, proxy, .

I am running an application within a container, that does not work with the environment variables http_proxy, http_proxy and no_proxy. Since the Application doesn’t respect the env vars, are there any options how to route traffic with linux system settings? Something like iptables, etc (would need some help here).

Details:
Every external domain should be routed through the proxy server (no authentication). And all internal traffic should not go through the proxy. Internal traffic is specified in the no_proxy var (something like: *.cluster.local, *.myinternal.domain.com).

Basically the same behavior like the env vars (http_proxy, https_proxy, no_proxy), but baked in without using them.
Right now the docker image is based on centos but could be alpine soon.

Thanks for any help.

You can use something like tsocks or proxychains. Both of them use a configuration file, where you can set exceptions (I think).

Leave a Reply

Your email address will not be published. Required fields are marked *