Haproxy route and rewrite based on URI path

前端 未结 2 1335
盖世英雄少女心
盖世英雄少女心 2020-12-05 15:26

I am trying to setup an Haproxy to load balance requests on a few backends identified by the uri path. For example:

https://www.example.com/v1/catalog

2条回答
  •  借酒劲吻你
    2020-12-05 15:44

    If I understand you correctly, replace the example below:

    reqrep ^([^\ ]\*)\ /([-.0-9A-Za-z]\*)/([a-zA-Z]\*)/(.\*)  \1\ /\3-\2/\4
    

    http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#reqrep

    reqrep search string [{if | unless} cond]
    

    You have no spaces.

提交回复
热议问题