[nginx] svn commit: r4258 - in branches/stable-1.0: . src/http/modules

igor at sysoev.ru igor at sysoev.ru
Tue Nov 1 14:19:14 UTC 2011


Author: is
Date: 2011-11-01 14:19:13 +0000 (Tue, 01 Nov 2011)
New Revision: 4258

Modified:
   branches/stable-1.0/
   branches/stable-1.0/src/http/modules/ngx_http_rewrite_module.c
Log:
Merging r4209:

Skipping location rewrite phase for server null location.



Property changes on: branches/stable-1.0
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:3960-3974,3977-3987,3991-3996,3998,4003-4007,4009-4013,4015-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143,4147-4152,4154-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4212,4219-4220,4229-4230,4232,4235,4237
   + /trunk:3960-3974,3977-3987,3991-3996,3998,4003-4007,4009-4013,4015-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143,4147-4152,4154-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209,4212,4219-4220,4229-4230,4232,4235,4237

Modified: branches/stable-1.0/src/http/modules/ngx_http_rewrite_module.c
===================================================================
--- branches/stable-1.0/src/http/modules/ngx_http_rewrite_module.c	2011-11-01 14:18:10 UTC (rev 4257)
+++ branches/stable-1.0/src/http/modules/ngx_http_rewrite_module.c	2011-11-01 14:19:13 UTC (rev 4258)
@@ -135,10 +135,22 @@
 static ngx_int_t
 ngx_http_rewrite_handler(ngx_http_request_t *r)
 {
+    ngx_int_t                     index;
     ngx_http_script_code_pt       code;
     ngx_http_script_engine_t     *e;
+    ngx_http_core_srv_conf_t     *cscf;
+    ngx_http_core_main_conf_t    *cmcf;
     ngx_http_rewrite_loc_conf_t  *rlcf;
 
+    cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
+    cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
+    index = cmcf->phase_engine.location_rewrite_index;
+
+    if (r->phase_handler == index && r->loc_conf == cscf->ctx->loc_conf) {
+        /* skipping location rewrite phase for server null location */
+        return NGX_DECLINED;
+    }
+
     rlcf = ngx_http_get_module_loc_conf(r, ngx_http_rewrite_module);
 
     if (rlcf->codes == NULL) {



More information about the nginx-devel mailing list