我的目標是將一些 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
haproxyconf 未經測試
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)]