atom feed15 messages in ru.sysoev.nginxRe: satisfy problem
FromSent OnAttachments
lhmwzyApr 7, 2011 8:51 am 
Francis DalyApr 7, 2011 10:00 am 
Thomas LoveApr 7, 2011 11:27 am 
lhmwzyApr 7, 2011 4:51 pm 
lhmwzyApr 7, 2011 4:52 pm 
Oleksandr V. Typlyns'kyiApr 7, 2011 5:08 pm 
lhmwzyApr 7, 2011 9:16 pm 
lhmwzyApr 7, 2011 9:53 pm 
Igor SysoevApr 11, 2011 3:11 am.Other
Igor SysoevApr 11, 2011 3:18 am.Other
lhmwzyApr 11, 2011 7:49 am 
lhmwzyApr 11, 2011 7:50 am 
lhmwzyApr 11, 2011 8:00 am 
ylshjxApr 11, 2011 7:19 pm 
ylshjxApr 11, 2011 7:28 pm 
Subject:Re: satisfy problem
From:Igor Sysoev (ig@sysoev.ru)
Date:Apr 11, 2011 3:18:53 am
List:ru.sysoev.nginx
Attachments:
patch.401.0 - 1k

On Mon, Apr 11, 2011 at 02:11:58PM +0400, Igor Sysoev wrote:

On Fri, Apr 08, 2011 at 12:16:34PM +0800, lhmwzy wrote:

another problem:

when use: location ^~ /ks/admin { satisfy any; allow 10.68.136.241/32; allow 10.66.23.80/32; deny all; auth_basic "passwd"; auth_basic_user_file ksadminpasswd; } then the 401 error page can not be customized,only show the default 401error page:

"401 Authorization Required

------------------------------------------------------------------------------- nginx/0.9.7 ".

The attached patch should fix the bug.

A new better patch.

-- Igor Sysoev http://sysoev.ru/en/

Index: src/http/ngx_http_core_module.c =================================================================== --- src/http/ngx_http_core_module.c (revision 3886) +++ src/http/ngx_http_core_module.c (working copy) @@ -1108,17 +1108,21 @@ ngx_http_core_post_access_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph) { + ngx_int_t access_code; + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "post access phase: %ui", r->phase_handler);

- if (r->access_code) { + access_code = r->access_code;

- if (r->access_code == NGX_HTTP_FORBIDDEN) { + if (access_code) { + if (access_code == NGX_HTTP_FORBIDDEN) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "access forbidden by rule"); }

- ngx_http_finalize_request(r, r->access_code); + r->access_code = 0; + ngx_http_finalize_request(r, access_code); return NGX_OK; }