直接贴代码

                reqrep ^([^\ ]*\ )/\ (.*)  \1/Channel/index.html\ \2
                reqrep ^([^\ ]*\ )/index\.(.*)\ (.*) \1/Channel/index.html\ \3
                reqrep ^([^\ ]*\ )/p/(\d+)\.htm(.*)\ (.*) \1/Shop/Product.aspx?id=\2\ \4
                reqrep ^([^\ ]*\ )/p/(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\.html\ (.*) \1/Shop/Product.aspx?id=\2&t=\3&c=\4&o=\5&s=\6&p1=\7&p2=\8\ \9
                reqrep ^([^\ ]*\ )/p/list\-(\d+)\.html\ (.*) \1/Goods/GoodsList.aspx?c=\2\ \3
                reqrep ^([^\ ]*\ )/p/list\-(\d+)\-(\d+)\.html\ (.*) \1/Goods/GoodsList.aspx?c=\2&b=\3\ \4
                #parameter max 10
                #reqrep ^HEAD\ /p/list\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\.html\ HTTP/1.1 HEAD\ /Goods/GoodsList.aspx?p=\1&c=\2&b=\3&at1=\4&at2=\5&at3=\6&f=\7&j=\8&o=\9&i=\10&t=\11&cs=\12\ HTTP/1.1
                reqrep ^([^\ ]*\ )/p/search-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(.*)\.html\ HTTP/1.1 \1/Search/ProductSearch.aspx?p=\2&o=\3&t=\4&i=\5&f=\6&j=\7&cs=\8&s=\9\ HTTP/1.1
                reqrep ^([^\ ]*\ )/p/search-(.*)\.html\ (.*) \1/Search/ProductSearch.aspx?s=\2\ \3
                reqrep ^([^\ ]*\ )/s/search-(\d+)-(\d+)-(.*)\.html\ (.*) \1/Search/ShopSearch.aspx?p=\2&o=\3&s=\4\ \5
                reqrep ^([^\ ]*\ )/s/search-(.*)\.html\ (.*) \1/Search/ShopSearch.aspx?s=\2\ \3
                reqrep ^([^\ ]*\ )/shop/(\d+)\.html\ (.*) \1/Shop/ProductList.aspx?sid=\2\ \3
                reqrep ^([^\ ]*\ )/shop/list\-(\d+)\.html\ (.*) \1/Shop/ProductList.aspx?sid=\2\ \3
                reqrep ^([^\ ]*\ )/shop/list\-(\d+)\-(\d+)\.html\ (.*) \1/Shop/ProductList.aspx?sid=\2&c=\3\ \4
                reqrep ^([^\ ]*\ )/shop/list\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(\d+)\-(.*)\-(.*)\-(.*).html\ (.*) \1/Shop/ProductList.aspx?p=\2&sid=\3&c=\4&o=\5&f=\6&b=\7&e=\8&s=\9\ HTTP/1.1
                reqrep ^([^\ ]*\ )/shop/list-(\d+)-(.*).html\ (.*) \1/Shop/ProductList.aspx?sid=\2&s=\3\ \4

注意:Haproxy的reqrep的参数不能超过9个

格式如下:

HTTP_METHOD HTTP_REQUEST HTTP_VERSION
GET /index.html HTTP/1.1