Open jamiees2 opened 9 years ago
I think the problem is that HAProxy does the address resolution on start up and then Netflix etc slowly change the ip addresses.
Hmm, how would you propose resolving that? I can't seem to find a fix that is different from adding service haproxy restart
to crontab.
Perhaps other alternatives to HAProxy like sniproxy are worth looking into. Regarding the automated restarts, perhaps this is enough: http://www.forouzani.com/reload-haproxy-cfg-without-restarting.html.
You need to add the check inter line to each backend server, this is force HAProxy to check the server and see if its up or down, IP chnage etc.
Something such as this (probably smaller numbers)
use-server cp143012-i.akamaihd.net if { req_ssl_sni -i cp143012-i.akamaihd.net } server cp143012-i.akamaihd.net cp143012-i.akamaihd.net:443 check inter 60000 fast inter 60000 down inter 60000 fall 14430
Oh neat! As you clearly know more about this than I do, would you mind sending a PR? :^)
Sure, will do that sometime tomorrow. Will probably jump on that Named/BIND generator too.
Any suggestions for getting haproxy to start if a domain has gone completely? Today I found atv.amazon.com did not resolve causing
[ALERT] 276/003112 (4325) : parsing [/etc/haproxy/haproxy.cfg:119] : 'server atv.amazon.com' : invalid address: 'atv.amazon.com' in 'atv.amazon.com:80'
I just pointed it to localhost in /etc/hosts as a workaround
Hmm, no, not really. I have yet to investigate the HAProxy configuration better, although I was researching sniproxy last weekend and am considering adding a generator for it, as it just seemed to work better regarding DNS lookups.
sniproxy is nice and I used it before, but Amazon Instant Video in combination with a Fire TV gave me headaches, until I found out that the Fire TV resolves some hostnames via DNS but sends the HTTP requests directly to the resolved IP. I was not able to find a workaround like the dnat setup here.
This is a somewhat annoying issue. It might just be an issue with HAProxy, but it might be possible to resolve with better config generation.