企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## header 语法 ``` header [<matcher>] [[+|-]<field> [<value>|<find>] [<replace>]] { <field> <find> <replace> [+]<field> <value> -<field> [defer] } ``` ### 实例 ``` # 设置自定义 头 header Custom-Header "My value" # 替换 http 为 https header Location http:// https:// # 批量设置头请求 header { # enable HSTS Strict-Transport-Security max-age=31536000; # disable clients from sniffing the media type X-Content-Type-Options nosniff # clickjacking protection X-Frame-Options DENY # keep referrer data off of HTTP connections Referrer-Policy no-referrer-when-downgrade } # 根据不同路由设置请求头 route { header Cache-Control max-age=3600 header /static/* Cache-Control max-age=31536000 } ```