應用場景: 同一個請求地址,根據header的某個值,來確定定向的目標服務器。如圖所示
在location 配置中,使用$http_XXX,來獲取header指定的值,$http_爲固定格式,XXX爲自定義字段名。
$http_XXX
$http_
XXX
server { location / { proxy_pass $http_redirecthost; } }