1
我需要nginx的上僅當rewrite_by_lua_block
響應包含與圖案(谷歌計算引擎平衡器健康檢查)自定義首部的部分位置返回200代碼。nginx的返回200,如果響應rewrite_by_lua_block頭包含圖案
我很新手在盧阿,所以任何幫助,非常感謝。
我需要nginx的上僅當rewrite_by_lua_block
響應包含與圖案(谷歌計算引擎平衡器健康檢查)自定義首部的部分位置返回200代碼。nginx的返回200,如果響應rewrite_by_lua_block頭包含圖案
我很新手在盧阿,所以任何幫助,非常感謝。
我建議嘗試(未經測試)
header_filter_by_lua_block {
if ngx.status == 200 then
local from, to, err = ngx.re.find(ngx.header.Foo, "your_regexp_here")
if not from then
ngx.status = 500 -- use the error code you need
end
end
}
請記住 - 你應該把header_filter_by_lua_block
指令到位置在您的請求被髮送真的向上遊,說,你通過rewrite_by_lua_block
重定向到。