将子域重定向到后端服务器文件夹

Redirect a subdomain to backend server folder

我在 serverA 192.168.1.90/wordpress 上安装了一个 wordpress 和一个名为 mlb.example.com.

的子域

在 Haproxy 中使用 ACL,如何重定向到后端并仍然保留子域名“mlb.example.com”,而不是仅在浏览器中显示 IP 和文件夹。

通过 ACL 路由。

acl host_wordpresswebsite hdr(主机)-i wordpresswebsite.acme.com [...]

use_backend wordpress 网站如果 host_wordpresswebsite [...]

后台wordpress网站 [...]

也许将 reqrep 添加到后端:

acl host_server hdr(host) -i mlb.example.com

use_backend wordpresswebsite if host_server

backend wordpresswebsite

reqrep ^([^\ :]*)\ /mlb.example.com/(.*)     \ /wordpress/mlb/