Skip to content

Commit 88c39f1

Browse files
committed
use yes or y values for the variable to enable persistent upstrand contexts
1 parent 511c9f0 commit 88c39f1

File tree

3 files changed

+22
-38
lines changed

3 files changed

+22
-38
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
continue-on-error: ${{ matrix.experimental }}
1010
strategy:
1111
matrix:
12-
nginx: [1.16.1, 1.18.0, 1.20.2, 1.22.1, 1.24.0, 1.26.2]
12+
nginx: [1.16.1, 1.18.0, 1.20.2, 1.22.1, 1.24.0, 1.26.3]
1313
nginx-easy-context: ['1.0']
1414
experimental: [false]
1515
include:
@@ -56,7 +56,7 @@ jobs:
5656
-O "nginx-easy-context-$NGXEASYCTXVER.tar.gz" &&
5757
tar xzvf "nginx-easy-context-$NGXEASYCTXVER.tar.gz"
5858
cd nginx-${NGXVER}/
59-
NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX=1 \
59+
NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX=yes \
6060
$NGX_CONFIGURE --add-module=../nginx-easy-context-$NGXEASYCTXVER \
6161
--add-module=.. --add-module=../echo-nginx-module
6262
make -j2

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -417,16 +417,12 @@ in the Nginx configuration file.
417417
To benefit from persistent request contexts and upstrand failover locations with
418418
internal redirections in them (*try_files*, *error_page* etc.), download module
419419
[nginx-easy-context](https://github.com/lyokha/nginx-easy-context) in some
420-
directory, uncomment line
421-
422-
```sh
423-
# NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX=1
424-
```
425-
426-
in file *config* in directory of this module and then run *configure* with two
427-
options *--add-module*.
420+
directory, set environment variable
421+
*NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX* to *y* or *yes*,
422+
and run *configure* with two options *--add-module*.
428423

429424
```ShellSession
425+
$ NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX=yes
430426
$ ./configure --add-module=/path/to/module/nginx-easy-context --add-module=/path/to/this/module
431427
```
432428

config

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
ngx_addon_name=ngx_http_combined_upstreams_module
22

3-
# uncomment next line to enable correct behavior of upstrand interception
4-
# locations with internal redirections, e.g. error_page or try_files
5-
# NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX=1
6-
7-
if test -n "$NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX"
3+
if [ "$NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX" = y ] ||
4+
[ "$NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX" = yes ]
85
then
6+
if [ "$ngx_easy_context_dir" = "" ]
7+
then
8+
echo "$0: error: unable to find nginx-easy-context module!"
9+
echo " Make sure that it was specified in one of --add-module "`
10+
`"or --add-dynamic-module options before this module"
11+
exit 1
12+
fi
913
ngx_module_incs="$ngx_easy_context_dir"
1014
NGX_EASY_CONTEXT_INC="$ngx_easy_context_dir/ngx_easy_context.h"
1115
else
@@ -23,31 +27,15 @@ NGX_HTTP_COMBINED_UPSTREAMS_MODULE_SRCS=" \
2327
$ngx_addon_dir/src/ngx_http_combined_upstreams_upstrand.c \
2428
"
2529

26-
if test -n "$ngx_module_link"
27-
then
28-
ngx_module_type=HTTP_AUX_FILTER
29-
ngx_module_name=$ngx_addon_name
30-
ngx_module_deps="$NGX_HTTP_COMBINED_UPSTREAMS_MODULE_DEPS"
31-
ngx_module_srcs="$NGX_HTTP_COMBINED_UPSTREAMS_MODULE_SRCS"
32-
33-
if test -n "$NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX"
34-
then
35-
ngx_module_incs="$ngx_easy_context_dir"
36-
fi
37-
38-
. auto/module
39-
else
40-
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name"
41-
NGX_ADDON_DEPS="$NGX_ADDON_SRCS $NGX_HTTP_CUSTOM_COUNTERS_MODULE_DEPS"
42-
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $NGX_HTTP_CUSTOM_COUNTERS_MODULE_SRCS"
30+
ngx_module_type=HTTP_AUX_FILTER
31+
ngx_module_name=$ngx_addon_name
32+
ngx_module_deps="$NGX_HTTP_COMBINED_UPSTREAMS_MODULE_DEPS"
33+
ngx_module_srcs="$NGX_HTTP_COMBINED_UPSTREAMS_MODULE_SRCS"
4334

44-
if test -n "$NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX"
45-
then
46-
CFLAGS="$CFLAGS -I$ngx_easy_context_dir"
47-
fi
48-
fi
35+
. auto/module
4936

50-
if test -n "$NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX"
37+
if [ "$NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX" = y ] ||
38+
[ "$NGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX" = yes ]
5139
then
5240
CFLAGS="$CFLAGS "`
5341
`"-DNGX_HTTP_COMBINED_UPSTREAMS_PERSISTENT_UPSTRAND_INTERCEPT_CTX"

0 commit comments

Comments
 (0)