I use Haproxy (1.6 on Ubuntu 12.04) as a SSL termination proxy in front of a Varnish server. Varnish listen several IPs, for virtual host purpose. So I want Haproxy to listen all IPs, and pass each request to Varnish with the same IP.
I saw {frontend_ip} in similar topics, but it doesn't seem to work... My global configuration works because if a put an IP instead of {frontend_ip}, it works.
[quote=“Kal, post:1, topic:647”]
Varnish listen several IPs, for virtual host purpose. So I want Haproxy to listen all IPs, and pass each request to Varnish with the same IP.[/quote]
This will never scale. Why can’t you use the Host Header to tell Varnish which server is meant?
This is not supported. Fix your real problem: which is the Host information has to be communicated at HTTP level, not IP level between Haproxy and Varnish. Then you will have a lot less problems overall.
I have hundreds of sites (and then hundreds of domains) spread over 6 virtual hosts (currently), it would not be very convenient to use host to select backends in Varnish.
I don’t really understand the problem with using a huge configuration, isn’t the varnish configuration compiled into C? And don’t you need a similar configuration anyway when its IP based?
I assume that the configuration of new domains is automated anyway.
You need specific, per domain configurations, you will either have a huge haproxy or a huge varnish configuration. I suggest you automatize the problem away.