aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_realip_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_realip_module.c')
-rw-r--r--src/http/modules/ngx_http_realip_module.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_realip_module.c b/src/http/modules/ngx_http_realip_module.c
index dba3c527b..5e3355c96 100644
--- a/src/http/modules/ngx_http_realip_module.c
+++ b/src/http/modules/ngx_http_realip_module.c
@@ -141,15 +141,15 @@ ngx_http_realip_handler(ngx_http_request_t *r)
ngx_http_realip_ctx_t *ctx;
ngx_http_realip_loc_conf_t *rlcf;
- ctx = ngx_http_get_module_ctx(r, ngx_http_realip_module);
+ rlcf = ngx_http_get_module_loc_conf(r, ngx_http_realip_module);
- if (ctx) {
+ if (rlcf->from == NULL) {
return NGX_DECLINED;
}
- rlcf = ngx_http_get_module_loc_conf(r, ngx_http_realip_module);
+ ctx = ngx_http_realip_get_module_ctx(r);
- if (rlcf->from == NULL) {
+ if (ctx) {
return NGX_DECLINED;
}