OpenWrt Forum Archive

Topic: HAProxy + OpenWRT for subdomain name level access of servers?

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I wish to use HAProxy to connect to my home network's various web-servers via subdomains from the internet.

I've tried to write this post numerous times but the spam policy here won't let me post it claiming "Too more links in message. Allowed 0 links. Reduce number of links and post it again."

So instead, here is my question posted on PASTEBIN (a real link which apparently the forum will permit??)

pastebin.com/b3c6PL8W

I now have this working and want to share my solution for others.

I think this is something a lot of people are looking for - let me know if you run into trouble.

In the config file example you will see there are several domain names configured to point to various LAN ip addresses/ports.

I had to move LuCl listen port to 80 because only one can bind at a time and haproxy is being bound to 80

Each of these endpoints are completely URL/Port independent and you should be able to add as many as you need/like

I also configured port 443 for SSL so all communication between the outside client and the HAProxy can be encrypted which is nice.  I'll work next on getting certbot or similar working with this as my current cert is self-signed.  If you have any experience with this part please feel free to share.

haproxy cfg is in paste below

pastebin.com/UWKs5yCy

(Last edited by newgeo on 1 Jun 2017, 16:05)

Hi @newgeo,
what is your router model? I am interested in this same configuration, thanks for sharing. How did you implement SSL? HAproxy comes without SSL support.

Denis

Hello @denics

I don't believe I needed to do anything special except for what is in the config but would be willing to try to answer any more direct questions you might have.

haproxy -v yielded:

HA-Proxy version 1.5.14-patch04 2015/07/02
Copyright 2000-2015 Willy Tarreau <willy@haproxy.org>

Router is Asus RT-N16

OpenWrt is CHAOS CALMER (15.05, r46767)

(Last edited by newgeo on 16 Oct 2017, 16:46)

The discussion might have continued from here.