Maxim Dounin mdounin at mdounin.ru
Tue Jul 8 21:40:58 UTC 2014


On Tue, Jul 08, 2014 at 03:27:21PM -0400, matt_l wrote:

> Hello
> I am new to nginx. This is most likely a beginner question. I apologize in
> advance.
> I have a client that is sending http request with an x-security-header:
> a6rb35723926d2c685c2d7ud3034179828blablabla
> How can I configure nginx so that if the x-security-header is not present
> then the request is rejected?

Conditional processing like this can be implemented using 
directives of the rewrite module, "if" and "return" in particular:

    if ($http_x_security_header != "a6rb35723926d2c685c2d7ud3034179828blablabla") {
        return 403;

See here for details:


Maxim Dounin

More information about the nginx mailing list