【发布时间】:2019-05-23 11:19:08
【问题描述】:
我需要为项目实施 URL 重写操作。这必须使用 HAProxy-1.5 来完成,因为它是在 PfSense 防火墙上实现的,并且目前还没有更高版本。
我有以下网址: update.domain.com 存储库.domain.com 它们都指向同一个后端 server1。现在的挑战是移动文档根: - update.domain.com >> /some/path/repo1。 - repository.domian.com >> /some/path/repo2
不仅文档根被移动,而且由于 TMG 服务器的早期实现存在指向如下文件的链接: update.domain.com/file1.txt
我尝试在前端使用 http-request set-path 和一些 ACL,但不幸的是,此功能适用于 > haproxy-1.6
frontend www
bind *:80
acl update_url hdr_beg(host) -m beg update.domain.com
acl update_root path_beg /some/path/repo1/
http-request set-header /some/path/repo1/%[path] if !update_root update_url
use_backend testServer if update_root update_url
default_backend testServer
无法更改指向 update.domain.com/file1.txt 等文件的链接。保留 TMG 不是解决方案。我怎样才能让它与 Haproxy-1.5 一起使用?
【问题讨论】:
标签: configuration url-rewriting acl haproxy