Score:0

HAProxy backend with different path prefix per server

et flag
EM0

Is it possible to configure an HAProxy backend with multiple servers and different path prefix for each server? I want something like this:

backend mybackend
    server node1 server1.example.com/ONE_PATH/%[path]
    server node2 server2.example.com/ANOTHER_PATH/%[path]

However the server directive does not support specifying a path, only a host and port.

https://unix.stackexchange.com/questions/420303/haproxy-add-path-to-backend-server asks this question, but only for one backend server. The answer there is to use http-request set-path, but that is per-backend, not per-server, and as I understand there is no way to know which server the request will be sent to at the time the http-request set-path is run.

HAProxy Per server URL rewriting in the backend (reqirep?) also asks something similar, and the answer is "not possible", but that was in 2010 and I'm not looking to do arbitrary URL rewriting - just a fixed path prefix per server.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.