$google_schema_reverse
The $google_schema_reverse 变量包含一个字符串,用于指示针对某个请求的 Google schema 实现是否应被反转。 — NGINX Module for Google Mirror creation
$google_schema_reverse
NGINX Module for Google Mirror creation
说明
The $google_schema_reverse 变量在 NGINX 的 Google 过滤模块中使用,用于在处理请求期间管理 Google schema 实现的方向性。当 NGINX 配置中的特定条件触发该变量的行为时(例如当根据模块逻辑预定义的模式匹配到某些请求 URI 或参数时),该变量会被设置。如果启用,该变量会影响 schema 信息在 HTTP 响应中的表示方式,特别是决定它是否应反映默认 Google schema 的 'reverse' 映射或解释。 通常,$google_schema_reverse 的取值可以是 'true' 或 'false',从而允许在配置文件中进行直接的条件检查。这使得能够更精细地控制 NGINX 如何与针对 Google 服务的请求交互,尤其是在需要根据应用需求以不同方式呈现或处理 schema 数据时,例如为兼容性或搜索引擎的反向索引需求。此功能确保终端用户可以以所需的 schema 表示方式浏览镜像的 Google 体验,以满足其特定用例。
配置示例
location / {
google on;
if ($google_schema_reverse) {
# Additional configuration for reverse schema processing
add_header X-Google-Schema 'Reversed';
}
}子系统
http可缓存
否上下文
http, server, location, if⚠
确保在 NGINX 配置中已正确启用 google filter module;否则,该变量将无法按预期工作。
⚠
对何时检查 $google_schema_reverse 的逻辑产生混淆——应在启用 google feature 之后执行,并且不要与 location rules 冲突。