HAProxy configuration on VS with Plesk 12 ?

On one virtual server I would like to run HAProxy in order to do load-balancing for standalone webapps.

With plesk I manage several domains, sharing the same IP. All use the same Apache Webserver.

I would like HAProxy to distribute load for 3 standalone Webapps while forwarding all other traffic to the corresponding domains.

So for example:
https://www.seminar.pro/registration/ should be distributed to https://www.seminar.pro:8881, https://www.seminar.pro:8882, etc

but calls for any other url should just be forwarded without alteration, for example:
http://www.seminarhosting.ch/whatever.cgi goes to http://www.seminarhosting.ch/whatever.cgi

Is this possible and does anyone have a similar HAProxy configuration, which could be shared?

Hi Oliver

Yes you can route to different backends using various triggers. For instance, different domain names or different paths. If I understand what you are asking, you can set up a ACL for the /registration/ path and then a default backend to send everything else to your apache configuration. It might look something like this:

 # Anything that comes in here to the path /registration route to registration app
        acl registration_access url_beg /registration
        use_backend registration_app if registration_access

# Setup default routing
        default_backend apache_server

# Then your backends might look something like this
# Use whatever are the correct ports for your apache server and your Xojo app instances
        backend registration_app
                server node1 127.0.0.1:8881
                server node1 127.0.0.1:8882
                server node1 127.0.0.1:8883

        backend apache_server
                server nodeApache 127.0.0.1:9000

That should do what I believe you are looking for. Anything to a URL beginning with “/registration” will go to your apps.
You can also route based on domains like this:

# Route based on domain name
       # Define hosts
        acl host_seminar hdr(host) -i seminar.pro
        acl host_otherdomain hdr(host) -i otherdomain.com

        # figure out which one to use
        use_backend seminar if host_seminar
        use_backend otherdomain if host_otherdomain

Hope this helps.
John