问题
I would like to redirect request from:
http://myrepo/mytest.git/
to
http://myrepo/mytest.git
so, removing the trailing slash in haproxy. any hint ?
Here's what I tried both in frontend and backend:
reqrep ^(.*)[\/]$ \1
回答1:
you can try like this.
frontend nginx
bind *:5000
mode http
option forwardfor
option httpclose
acl old_url path_beg -i /mytest.git
reqrep ^(.*)[\ /]$ \1
redirect prefix / code 301 if old_url
default_backend tomcats
backend tomcats
mode http
server tomcat01 X.X.X.X:8080 check inter 2000
来源:https://stackoverflow.com/questions/29640934/haproxy-remove-trailing-slash