Hi Nginx Forum
This is my first posting here.
I'm trying to configure an application to only allow traffic if a certain header value matches exactly. I'm trying the "if" statement below in my nginx app config file, but doesn't seem to quite work. It just gives a 403 for every request. If I change the != to = it allows allows all traffic through. "nginx -T" doesn't report any issues. Any suggestions on what else might be required? Thanks a lot.
location / {
if ($http_headerkey != "headervalue") {
return 403; }
allow ....
allow ....