首页 > 解决方案 > 如何在 Nginx 上获取 :authority 标头?

问题描述

如何在 Nginx 上获取:authority http 标头?

HTTP/2 支持默认有 ":authority" 标头

我需要检查 $host 与 $http_authority 的匹配,但 $http_authority 为空。

if ( $http_authority  ~* $host ) { return 405;  } 

在此处输入图像描述

谢谢

标签: nginx

解决方案


use $http_host or $host replace $http_authority like http.


推荐阅读