--- src/http/ngx_http_core_module.c.orig	2012-12-18 19:39:39.000000000 +0100
+++ src/http/ngx_http_core_module.c	2013-01-18 16:26:32.000000000 +0100
@@ -1141,7 +1141,11 @@
         }
 
         if (rc == NGX_HTTP_FORBIDDEN || rc == NGX_HTTP_UNAUTHORIZED) {
-            r->access_code = rc;
+            
+	    /* do not overwrite unauth with forbidden when satisfy any is set */
+	    if (clcf->satisfy == NGX_HTTP_SATISFY_ALL || r->access_code != NGX_HTTP_UNAUTHORIZED) {
+	    	r->access_code = rc;
+	    }					                
 
             r->phase_handler++;
             return NGX_AGAIN;
