Skip to content

Commit

Permalink
Compatible with the mainline version of NGINX. #9
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP committed Dec 9, 2020
1 parent aeeae44 commit f31f906
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 38 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/dev.yml
Expand Up @@ -27,11 +27,6 @@ jobs:
lastversion download nginx:${{ matrix.nginx }}
mkdir nginx-src
tar zxf nginx-*.tar.gz --directory nginx-src --strip-components=1
- name: Compatibility handling
if: ${{ matrix.nginx == 'mainline' }}
run: |
export NGX_WAF_COMPATIBLE_WITH_MAINLINE=TRUE
bash scripts/compatible-with-mainline.sh
- name: Configure
run: |
cd nginx-src
Expand Down
12 changes: 0 additions & 12 deletions README-ZH-CN.md
Expand Up @@ -57,18 +57,6 @@ cd ngx_waf

***

**兼容 Mainline 版本的 nginx**

如果你打算将本模块安装到 Mainline 版本的 nginx 上,你需要在编译和安装之前执行下列命令。

```bash
cd /usr/local/src/ngx_waf
export NGX_WAF_COMPATIBLE_WITH_MAINLINE=TRUE
bash scripts/compatible-with-mainline.sh
```

***

**使用静态模块**

```bash
Expand Down
12 changes: 0 additions & 12 deletions README.md
Expand Up @@ -59,18 +59,6 @@ Using dynamic modules only needs to load the `.so` at runtime, without recompili

***

**Compatible with mainline nginx**

If you plan to install this module on the Mainline version of nginx, you need to execute the following commands before compiling and installing it.

```bash
cd /usr/local/src/ngx_waf
export NGX_WAF_COMPATIBLE_WITH_MAINLINE=TRUE
bash scripts/compatible-with-mainline.sh
```

***

**use static modules**

```bash
Expand Down
6 changes: 3 additions & 3 deletions inc/ngx_http_waf_module_config.h
Expand Up @@ -247,10 +247,10 @@ static void* ngx_http_waf_create_srv_conf(ngx_conf_t* cf) {
return NULL;
}
ngx_str_null(&srv_conf->waf_rule_path);
#ifdef COMPATIBLE_WITH_MAINLINE
srv_conf->ngx_log = ngx_log_init((u_char *)"ngx_waf: ", NULL);
#else
#if (nginx_version == 1018000)
srv_conf->ngx_log = ngx_log_init((u_char *)"ngx_waf: ");
#else
srv_conf->ngx_log = ngx_log_init((u_char *)"ngx_waf: ", NULL);
#endif
srv_conf->ngx_pool = ngx_create_pool(sizeof(ngx_pool_t) + INITIAL_SIZE, srv_conf->ngx_log);
srv_conf->alloc_times = 0;
Expand Down
6 changes: 0 additions & 6 deletions scripts/compatible-with-mainline.sh

This file was deleted.

0 comments on commit f31f906

Please sign in to comment.