I have a http-only and secure (ssl) cookie, and I want nginx to check
whether this cookie exists in a request, if not, reject it by serving a 404
page. This is just a preliminary check, so I don't care about the actual
value in the cookie.

So far I've tried this: if ($http_cookie !~* "cookie_name=[.]+") { return
404; } in a location directive, but despite the cookie is contained in the
requests, 404 is returned. What should be corrected here? Thanks!

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,236394,236394#msg-236394

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to