我设置了一个 HAProxy 来将流量重定向到一些内部服务器。
我要做的是根据请求主机设置一些响应标头。不幸的是,我无法让它工作。
当前设置如下所示
acl mywebsite req.hdr(host) -i example.com
http-response set-header X-Frame-Options SAMEORIGIN if mywebsite
http-response set-header X-XSS-Protection 1;mode=block if mywebsite
http-response set-header X-Content-Type-Options nosniff if mywebsite
Run Code Online (Sandbox Code Playgroud)
据我了解,http-response set-header 无法读取请求标头。有没有办法解决?