This repository has been archived by the owner on Apr 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In way over my head, and have only cobbled this together through copi…
…ous copy/paste action.
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ngx_addon_name=ngx_http_static_etags_module | ||
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_static_etags_module" | ||
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_static_etags_module.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright 2008 Mike West ( http://mikewest.org/ ) | ||
* | ||
* The following is released under the Creative Commons BSD license, | ||
* available for your perusal at `http://creativecommons.org/licenses/BSD/` | ||
*/ | ||
#include <ngx_config.h> | ||
#include <ngx_core.h> | ||
#include <ngx_http.h> | ||
|
||
#define ALLOWED_METHODS (NGX_HTTP_GET|NGX_HTTP_HEAD) | ||
|
||
static void * | ||
ngx_http_static_etags_create_loc_conf(ngx_conf_t *cf); | ||
|
||
static char * | ||
ngx_http_static_etags_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child); | ||
|
||
static char * | ||
ngx_http_static_etags_post_handler(ngx_conf_t *cf, void *data, void *conf); | ||
|
||
typedef struct { | ||
ngx_str_t path; | ||
ngx_str_t type; | ||
} ngx_http_static_etags_loc_conf_t; | ||
|
||
static ngx_http_module_t ngx_http_notice_module_ctx = { | ||
NULL, /* preconfiguration */ | ||
NULL, /* postconfiguration */ | ||
|
||
NULL, /* create main configuration */ | ||
NULL, /* init main configuration */ | ||
|
||
NULL, /* create server configuration */ | ||
NULL, /* merge server configuration */ | ||
|
||
ngx_http_static_etags_create_loc_conf, /* create location configuration */ | ||
ngx_http_static_etags_merge_loc_conf, /* merge location configuration */ | ||
}; | ||
|
||
|
||
ngx_module_t ngx_http_notice_module = { | ||
NGX_MODULE_V1, | ||
&ngx_http_static_etags_module_ctx, /* module context */ | ||
ngx_http_static_etags_commands, /* module directives */ | ||
NGX_HTTP_MODULE, /* module type */ | ||
NULL, /* init master */ | ||
NULL, /* init module */ | ||
NULL, /* init process */ | ||
NULL, /* init thread */ | ||
NULL, /* exit thread */ | ||
NULL, /* exit process */ | ||
NULL, /* exit master */ | ||
NGX_MODULE_V1_PADDING | ||
}; | ||
|
||
|
||
static void * | ||
ngx_http_static_etags_create_loc_conf(ngx_conf_t *cf) | ||
{ | ||
ngx_http_static_etags_conf_t *conf; | ||
|
||
conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_static_etags_conf_t)); | ||
if (conf == NULL) return NGX_CONF_ERROR; | ||
|
||
return conf; | ||
} |