Reject Nginx request with no authentication in general

view full story

http://serverfault.com – Is it possible to reject all nginx request, which don't send basic authentication data with them? I have requests like this: xxx.xxx.xxx.xxx - - [24/Oct/2012:10:32:12 +0200] "POST /path HTTP/1.1" 401 1387 "-" "Apache-HttpClient/4.1.1 (java 1.5)" "-" xxx.xxx.xxx.xxx - paul [24/Oct/2012:10:32:12 +0200] "POST /path HTTP/1.1" 200 192 "-" "Apache-HttpClient/4.1.1 (java 1.5)" "-" and i want reject the first one, which don't provide the user. As you can see it already sends the 401 HTTP code, but this code is generated not directly from nginx but from an underlying application server. What I want (HowTos)