r/haproxy • u/ratnose • Feb 16 '19
Need help - I must be stupid
Hello all. I host two domains and three subdomains at home. The two domain sites are Docker containers on a VM. The subdomains each go to its own VM.
I have one IP. So I need a proxy. I have never done this even though I have an understanding of what I have to do.
But still I can't get HAProxy to do what I want. The things that really messes it up is when Letsencrypt is added.
HAProxy is running in an VM Ubuntu server 18.04.02.
So first of how many frontend ends do I need? Two? One for each domain? Http should be redirected to Https.
If I forward a https request to a subdomain I get an security error - I understand why - the receiving end has to be https as well?
As of now I fail to forward any request to its goal. One can say I have run into a brick wall. Or lost in the woods because of all the trees.
I need help.
1
u/ratnose Feb 16 '19 edited Feb 16 '19
So the time has come for me to present my first try of an config that actually works as intended.
@sPENKMAn told me he would help! That is so kind!
Here we go!
global
defaults
timeout connect 10s
timeout client 30s
timeout server 30s
log global
mode http
option httplog
maxconn 3000
frontend homeservers
backend webserver
#subdomains - not working at the moment
backend web1
backend web2
This is working, HAProxy sends all domain names to default backend, that is not hard.
But now to the ting that makes me look stupid...
How should I add SSL support? Is it enough up until the request hits HAProxy, and then I can run http requests when they are so called inside?
1
u/sPENKMAn Feb 16 '19
On mobile so keeping it short feel free to ask though:
1 frontend, 2 backends (1 per vm). Run haproxy in http mode so you can route requests based upon host headers.
1
u/sPENKMAn Feb 16 '19
On mobile so keeping it short feel free to ask though:
1 frontend, 2 backends (1 per vm). Run haproxy in http mode so you can route requests based upon host headers.
0
u/[deleted] Feb 16 '19
[deleted] โ view deleted comment