我想从域前缀重写路径。有两种情况:
我尝试使用此配置重写路径。但是我无法在reqirep中从域中提取前缀。我认为reqrep仅适用于GET / XXXX HTTP / 1.1字符串,而不是完整的URL。
acl match path_end -i /path
acl match1 path_end -i /path1
use_backend traefik_path if match
use_backend traefik_path1 if match1
default_backend traefik_path
backend traefik_path
reqirep ^([^\ ]*\ /)path \1/path/#/??
balance roundrobin
server traefik 127.0.0.1:8000 check
backend traefik_path1
reqirep ^([^\ ]*\ /)path1 \1/path1/#/??/home
balance roundrobin
server traefik 127.0.0.1:8000 check