Consider the following situation:
Internet
||
||
.------''------.
| HTTPS (:443) |
'------..------'
||
.-----------------------'|
| \/
| 3rd party HAproxy service
| ||
| ||
optional .-----------''-----------.
route | PROXY Protocol (:5443) |
| '-----------..-----------'
| || ________
___________|_______________________||________________________________| SERVER |____
| | \/ |
| | local HAproxy |
| | || |
| | || |
| | .------''------. |
| | | HTTPS (:443) | |
| | '------..------' |
| | || |
| | || |
| | \/ |
| '---------------> local webserver |
|___________________________________________________________________________________|
The backend server has both HAproxy and Apache httpd locally running on port 5443 and 443 respectively.
My local webserver does not support the PROXY protocol. So I want HAproxy to catch the PROXY Protocol from the 3rd party service, and pass the data to the local webserver in either HTTPS or simply a TCP pass-through.
In the case of HTTPS I suppose it should manipulate the HTTP packets using the correct SSL-certificate to add the original sender IP in the X-Forwarded-For
HTTP headers (which should be provided by the PROXY protocol).
However, the documentation of HAproxy is awful if you are new to HAproxy, and I could not find examples that explain how to do this. I know it has to be possible since HAproxy is listed as "Proxy-protocol ready software", but how?