Skip to content

Commit eb01d48

Browse files
committed
Modify the NGINX module type to HTTP
1 parent 00df9d5 commit eb01d48

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

nginx/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ngx_module_type=CORE
1+
ngx_module_type=HTTP
22
ngx_module_name=ngx_python_module
33
ngx_module_srcs="$ngx_addon_dir/ngx_python_module.c"
44

nginx/ngx_python_module.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <ngx_config.h>
22
#include <ngx_core.h>
3+
#include <ngx_http.h>
34
#include <Python.h>
45
#include "nginx.h"
56

@@ -10,18 +11,26 @@ static void ngx_python_exit_process(ngx_cycle_t *cycle);
1011
static wchar_t *python_exec = NULL;
1112

1213

13-
static ngx_core_module_t ngx_python_module_ctx = {
14-
ngx_string("python"),
15-
NULL,
16-
NULL
14+
static ngx_http_module_t ngx_python_module_ctx = {
15+
NULL, /* preconfiguration */
16+
NULL, /* postconfiguration */
17+
18+
NULL, /* create main configuration */
19+
NULL, /* init main configuration */
20+
21+
NULL, /* create server configuration */
22+
NULL, /* merge server configuration */
23+
24+
NULL, /* create location configuration */
25+
NULL /* merge location configuration */
1726
};
1827

1928

2029
ngx_module_t ngx_python_module = {
2130
NGX_MODULE_V1,
2231
&ngx_python_module_ctx, /* module context */
2332
NULL, /* module directives */
24-
NGX_CORE_MODULE, /* module type */
33+
NGX_HTTP_MODULE, /* module type */
2534
NULL, /* init master */
2635
NULL, /* init module */
2736
ngx_python_init_process, /* init process */

0 commit comments

Comments
 (0)