1
+ /*
2
+ * Copyright 2008 Mike West ( http://mikewest.org/ )
3
+ *
4
+ * The following is released under the Creative Commons BSD license,
5
+ * available for your perusal at `http://creativecommons.org/licenses/BSD/`
6
+ */
7
+ #include <ngx_config.h>
8
+ #include <ngx_core.h>
9
+ #include <ngx_http.h>
10
+
11
+ #define ALLOWED_METHODS (NGX_HTTP_GET|NGX_HTTP_HEAD)
12
+
13
+ static void *
14
+ ngx_http_static_etags_create_loc_conf (ngx_conf_t * cf );
15
+
16
+ static char *
17
+ ngx_http_static_etags_merge_loc_conf (ngx_conf_t * cf , void * parent , void * child );
18
+
19
+ static char *
20
+ ngx_http_static_etags_post_handler (ngx_conf_t * cf , void * data , void * conf );
21
+
22
+ typedef struct {
23
+ ngx_str_t path ;
24
+ ngx_str_t type ;
25
+ } ngx_http_static_etags_loc_conf_t ;
26
+
27
+ static ngx_http_module_t ngx_http_notice_module_ctx = {
28
+ NULL , /* preconfiguration */
29
+ NULL , /* postconfiguration */
30
+
31
+ NULL , /* create main configuration */
32
+ NULL , /* init main configuration */
33
+
34
+ NULL , /* create server configuration */
35
+ NULL , /* merge server configuration */
36
+
37
+ ngx_http_static_etags_create_loc_conf , /* create location configuration */
38
+ ngx_http_static_etags_merge_loc_conf , /* merge location configuration */
39
+ };
40
+
41
+
42
+ ngx_module_t ngx_http_notice_module = {
43
+ NGX_MODULE_V1 ,
44
+ & ngx_http_static_etags_module_ctx , /* module context */
45
+ ngx_http_static_etags_commands , /* module directives */
46
+ NGX_HTTP_MODULE , /* module type */
47
+ NULL , /* init master */
48
+ NULL , /* init module */
49
+ NULL , /* init process */
50
+ NULL , /* init thread */
51
+ NULL , /* exit thread */
52
+ NULL , /* exit process */
53
+ NULL , /* exit master */
54
+ NGX_MODULE_V1_PADDING
55
+ };
56
+
57
+
58
+ static void *
59
+ ngx_http_static_etags_create_loc_conf (ngx_conf_t * cf )
60
+ {
61
+ ngx_http_static_etags_conf_t * conf ;
62
+
63
+ conf = ngx_pcalloc (cf -> pool , sizeof (ngx_http_static_etags_conf_t ));
64
+ if (conf == NULL ) return NGX_CONF_ERROR ;
65
+
66
+ return conf ;
67
+ }
0 commit comments