1.5 版中的新http-response add-header指令是该指令。正如文档中所写的那样- 这可以用于frontend,backend和listen。
我在一个frontend部分中尝试做的事情:
use_backend some_backend if some_condition
http-response add-header Vary Origin if some_condition
Run Code Online (Sandbox Code Playgroud)
但这没有效果。放置在该backend部分中的同一行工作得很好。有人可以帮助我理解,我在这里缺少什么吗?我不明白,为什么这在该frontend部分不起作用。
My guess would be that within the fronted there is no response yet and so the directive fails. I tried using it before and after die use_backend directive.
haproxy ×1