Skip to content

Instantly share code, notes, and snippets.

@drmalex07
drmalex07 / README-reverse-proxy-in-haproxy.md
Last active February 7, 2023 14:55
Perform simple reverse-proxying in HAProxy. #reverse-proxy #proxy #haproxy #proxypass

A more complete example (with rewriting cookie domains/paths) can be found at http://blog.haproxy.com/2014/04/28/howto-write-apache-proxypass-rules-in-haproxy/

We will try something roughly equivalent to the following ProxyPass directives in Apache2:

ServerName www.example.com
...
ProxyPass        /foo/  http://foo.local
ProxyPassReverse /foo/  http://foo.local

In haproxy.cfg we define a backend, say foo, to reverse-proxy to foo.local backend server.