On Sat, May 28, 2016 at 12:48 PM, Larry Martell <larry.mart...@gmail.com> wrote:
> Is there any way with nginx to check a request's headers and send back > a 401 if the headers are not proper? > Yes, you can do with this via the 'map' and 'if' directives. A trivial example: http { # if the "X-Foo" request header contains the phrase 'data', set $bar to 1; otherwise, set it to 0 map $http_x_foo $bar { default 0; "~data" 1; } server { location /t { if ($bar) { return 401; } } } See also http://nginx.org/en/docs/http/ngx_http_map_module.html and http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if
_______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx