0

I am trying to configure haproxy to accept a connection from a client - parse a URL from GET params and then proxy that connection. So this was the client IP is hidden from the 3rd party and headers can be adjusted.

I've tried various configs but cannot get it to work. This is my latest effort. The redirects did not work as these allow the 3rd party to discover the clients real IP address.

frontend client
    mode http
    bind 192.168.202.207:80
    log                     global
    option                  httplog
    default_backend         proxy

backend proxy
    mode http
    option transparent
    acl need_redirect urlp(goelsewhere) -m found
    http-request add-header TestHeader %[urlp(goelsewhere),url_dec]
    http-request del-header User-Agent
#    http-request redirect location %[urlp(goelsewhere),url_dec] if need_redirect
    server servA 0.0.0.0
2
  • 1
    I really don't think HAProxy is the best tool for this job. It's not meant to act as a web proxy (like Squid), but rather as a reverse proxy. The former generally knows it's clients, but not the resources it's asked to serve, while the latter rarely knows about it's clients, but knows a great deal about the requested resources. I'd venture to say you fall into the first category here.
    – GregL
    Jan 31 '17 at 1:48
  • There may be better tools this is the 1st one we are looking at. In the docs though they do say this Address "0.0.0.0" or "*" has a special meaning. It indicates that the connection will be forwarded to the same IP address as the one from the client connection. We may end up writing our own or extend haproxy with lua Jan 31 '17 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.