testcookie_domain
`testcookie_domain` 指令指定与用于 NGINX testcookie 机器人缓解模块的挑战响应 cookie 相关联的域名。
NGINX testcookie robot mitigation module
·
httpserverlocation
语法testcookie_domain domain;
默认值none
上下文http, server, location
参数1
说明
testcookie_domain 指令是 NGINX testcookie 机器人缓解模块的一部分,该模块通过基于 cookie 的机制对潜在的自动化机器人发起挑战。通过设置该指令,管理员可以定义挑战 cookie 的域名,这会影响浏览器接受该 cookie 的方式和时间。如果未显式设置,默认行为是将 cookie 分配给由浏览器确定的域名,从而基于现有域配置实现更灵活的 cookie 处理。
配置示例
http {
testcookie on;
testcookie_domain example.com;
}⚠
确保所指定的域名正确,并在必要时包含相应的子域;否则,cookie 可能无法正确设置。
⚠
如果域名与服务器的主机名不匹配,将此指令与其他 cookie 指令混合使用可能会产生意外行为。