我设置了一个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据我所知,http-response header无法读取请求头。有办法绕过这件事吗?
发布于 2018-04-20 06:49:47
您可以使用set-var
http-request set-var(txn.host) hdr(Host)
acl myhost var(txn.host) -m str example.com
http-response set-header X-Frame-Options SAMEORIGIN if myhosthttps://serverfault.com/questions/908516
复制相似问题