I'm trying to make NginX or HAProxy use proxies while connecting to upstream URLs, something like this:
Browser -> Nginx/HAProxy -- SOCKS5 Tunnel --> Remote
I wonder if it's possible?
Edited:
Basically I would like to transparently proxy http requests:
Set up a local DNS resolver (e.g. unbound) and rewrite DNS entries pointing some domains to localhost;
NginX/HAProxy handles http requests based on their
Host
field (I'm also running a HTTP server) and proxies HTTP requests accordingly.
It would be quite useful to provide access to blocked domains without too many configurations on client side (especially in a Docker container, it would be rather difficult if it's an official image).