參考資料
https://www.haproxy.com/doc/aloha/7.0/haproxy/http_rewriting.html#add-a-header-in-the-response
這句話加在frontend塊下
mc_https on 其中mc_https是key on是value 可以自己定義
http-response add-header mc_https on
全局add header
http-request add-header ORIGIN-PROTOCOL http #key和value
針對某一個acl做header
http-request add-header ORIGIN-PROTOCOL http if is_wx
如果443和80寫在一個frontend里面的話 想對80的請求添加header
http-request add-header ORIGIN-PROTOCOL http if is_wx !{ ssl_fc }
#注意 1:http-request必須要放在 redirect的條件之前
2:請求過程中修改的header在瀏覽器里面是不顯示 瀏覽器顯示的是原始請求的request_header 用程序獲取即可
3: 自定義的header用大寫 不要用下劃線 中劃線可以