HAProxy community

So HAProxy is working but not the subdomain backends


#1

Heres my config file: https://pastebin.com/S6mvfMrE

http/s backends work but none of the ones that point to other servers.

Why not?


#2

All of your backends are HTTP backends. Can you be a little more specific?


#3

Ofc I can don’t know why I gave so little info.

So I got 2 domains they do point to another server and that works perfect.
Then I got 3 subdomains and for all of those I get an 503 service unavailable.

I have chosen not to include ssl to these since last time I did I ended up in an ssl jungle…

But if someone know how to fix that I am happy!
I hope this clears a few things up.


#4

And which ones are those? Please don’t make me guess.


#5

It is:
unifi.privetdrive.net
unms.privetdrive.net
quake.privetdrive.net

All those says their is no server to take care of the request.


#6

its likely because you are using hdr_end for your acl. Try changing this and using hdr, hdr_beg, or hdr_dom.


#7

I tried to change to hdr_dom and hdr_beg no difference. When using subdomain I get 503 Service Unavailable. And if I copy the URI from the Haproxy config and paste in to a browser I get to the server.


#8

Please try changing all your privetdrive.net domains to use hdr_beg, not just the 3 that are not working.


#9

This is my current config: https://pastebin.com/C07sLf6j

Still not working.


#10

I’m still learning ha proxy, so this may not be correct…but I think Id simplify my config and do something like this
https://pastebin.com/771knDyP


#11

You just need to read the log. If the backend is already the correct one, everything related to frontend configuration is irrelevant, including ACLs and use_backend directives, as you already hit the correct backend.

If the log says there is no server to take care of the requests, than that’s exactly what it is: you’ve configured health checks on the backends, if those health checks fail on all servers of the backend, then there is no server to respond to the request.

Find out why the the health checks fail. Try to curl a backend from the haproxy box. Check firewalls rules and connectivity to that backend.


#12

Ive checked the logs and they are suspiciously empty… thanks for the curl tip.
It really showed me what is wrong. As soon as I got the output I needed.
All the subdomains got either a 301 or a 302, that is not good.
This I have to figure out why.

So for some reason, for now unknown, all subdomains was parked, no setup at my domain controller. So I have removed all subdomains and will trust the *.domain instead.