我的目标是将一些 URL 重定向到一个 URL。我的意思是这是目标 URL:https://application.company.com
我想重定向: http://company.com https://company.com https://application.company.com http://application.company.com http://www.application.company.com https://www.application.company.com
到该目标 URL 在 HAProxy 中最好做什么?提前致谢
答案1
我会用地图。
company.com application.company.com
www.application.company.com application.company.com
haproxy conf 未经测试
listen redirector
bind :::80
http-request redirect code 301 location https://application.company.com !{ ssl_fc }
http-request redirect code 301 location https://%[req.hdr(host),lower,map(domain.map)]