[Groonga-commit] groonga/groonga at 3b99d41 [master] groonga-httpd: support "~" modifier in location such as "location ~ /d/..."

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Sep 16 14:11:12 JST 2016


Kouhei Sutou	2016-09-16 14:11:12 +0900 (Fri, 16 Sep 2016)

  New Revision: 3b99d4140a039c892d3b815959f4fe8bfa4a6ea6
  https://github.com/groonga/groonga/commit/3b99d4140a039c892d3b815959f4fe8bfa4a6ea6

  Message:
    groonga-httpd: support "~" modifier in location such as "location ~ /d/..."
    
    For example, the following location accepts only load and delete
    commands:
    
        location ~ ^/d/(load|delete) {
          groonga on;
          groonga_base_path /d/;
        }

  Modified files:
    src/httpd/nginx-module/ngx_http_groonga_module.c

  Modified: src/httpd/nginx-module/ngx_http_groonga_module.c (+13 -0)
===================================================================
--- src/httpd/nginx-module/ngx_http_groonga_module.c    2016-09-16 12:33:52 +0900 (7942232)
+++ src/httpd/nginx-module/ngx_http_groonga_module.c    2016-09-16 14:11:12 +0900 (2fb413c)
@@ -1322,6 +1322,19 @@ ngx_http_groonga_each_loc_conf(ngx_http_conf_ctx_t *http_conf,
     ngx_http_groonga_each_loc_conf_in_tree(location_conf->static_locations,
                                            callback,
                                            user_data);
+
+    if (location_conf->regex_locations) {
+      ngx_uint_t j;
+      for (j = 0; location_conf->regex_locations[j]; j++) {
+        ngx_http_core_loc_conf_t *regex_location_conf;
+
+        regex_location_conf = location_conf->regex_locations[j];
+        if (regex_location_conf->handler == ngx_http_groonga_handler) {
+          callback(regex_location_conf->loc_conf[ngx_http_groonga_module.ctx_index],
+                   user_data);
+        }
+      }
+    }
   }
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index