OPNsense Forum

Archive => 17.7 Legacy Series => Topic started by: yds on November 01, 2017, 01:51:22 am

Title: Tutorial for setting up HAProxy Reverse proxy server??
Post by: yds on November 01, 2017, 01:51:22 am
Would like to use HAProxy plugin to act as reverse proxy to serve up the different webserver hosts I have running behind my single WAN IP.   Currently using apache virtual hosts proxy pass to do this.   Is there a recent tutorial anywhere to guide me through the steps of setting this up in the current plugin GUI?  Have scoured the web, but haven't found one.  Closest I found was a pfsense tutorial using a older version of HAproxy to do this.  And it appears some things have changed.
Title: Re: Tutorial for setting up HAProxy Reverse proxy server??
Post by: fabian on November 01, 2017, 07:31:42 am
Is https://docs.opnsense.org/manual/how-tos/haproxy.html out of date? As far as I know 2.0 has not been released yet.
Title: Re: Tutorial for setting up HAProxy Reverse proxy server??
Post by: yds on November 02, 2017, 02:57:30 am
Is https://docs.opnsense.org/manual/how-tos/haproxy.html out of date? As far as I know 2.0 has not been released yet.

I did read through that documentation. I believe it is designed for Load balancing, rather than reverse proxy.  Would all of the steps be the same though for setting up a reverse proxy?  Main difference being that instead of adding multiple servers to backend, I would only add one for each server I set up?   It wasn't entirely clear to me from that.
Title: Re: Tutorial for setting up HAProxy Reverse proxy server??
Post by: dragon2611 on November 02, 2017, 12:47:20 pm
Only had a quick skim through that doc seems ok to me, just leave the balancing algorithm on "stick on source ip" and it should be fine, If there's only one backend for that domain/vhost the balancing algorithm won't make much difference anyway as it's only got one possible location to balance it to.

Essentially you are going to end up with ACL's that say if hostname = X use backend Y.

I've got it working with LE and non balanced backends, it looks a bit daunting at first but it's actually fairly straightforward once you get the hang of the flow.