ITeye博客

Nginx

共 1 篇文章

nginx 获取请求header

在nginx的location配置中,在获取header配置时,需要在header名称前面加上固定前缀“http_“,并将header名称中的“-”中划线变为下划线,举例说明: 例如: 自定义的header名称为X-TimerLocal,那在nginx中使用$http_x_timerlocal 来获取到X-TimerLocal的值。 if ($http_x_timerlocal = 'BIN') { rewrite ^(.*/timerbin/.*)$ https://$host$1 permanent; } 包含X-TimerLocal=BIN的header请求进行判断,如果发现路径中包含…

2018-02-01 10:49 · Nginx