I have a poorly performing web app that will be massively scaled out to cope with the weight of the internet.
Haproxy will be used to farm out the stateless web requests to many servers. However, there's still a limit to the traffic that can come and I'd like to prioritise genuine users.
Can haproxy be configured to send traffic from a particular referrer URL to a particular box?
E.g. if the deployment's gateway is mentioned in a news article I can redirect traffic from that article to a fast static HTML site saying something on the lines of "thank you for you interest, here's some info."?
If this is possible, perhaps someone could share a relevant snippet from the configuration file.
Yes, it can. From the documentation,
So you can check hdr_dir(referer) to see if it matches a particular path, and if it does, set a flag, and then send traffic to various destinations based on that flag.
Untested.
I came across this post, which talks about using a setup along these lines:
It should return a 403 to the block referral traffic. You should be able to amend the config to handle the traffic differently (i.e. pass to a different backed)