]> git.kaiwu.me - nginx.git/commitdiff
Realip: detect duplicate real_ip_header directive.
authorRuslan Ermilov <ru@nginx.com>
Mon, 23 May 2016 16:17:24 +0000 (19:17 +0300)
committerRuslan Ermilov <ru@nginx.com>
Mon, 23 May 2016 16:17:24 +0000 (19:17 +0300)
src/http/modules/ngx_http_realip_module.c

index cfaa4c9789851179aeae8e8178eed004a198ec64..fca81eb26780fbeb2c71c08b167e9b0c0d546a33 100644 (file)
@@ -387,6 +387,10 @@ ngx_http_realip(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
     ngx_str_t  *value;
 
+    if (rlcf->type != NGX_CONF_UNSET_UINT) {
+        return "is duplicate";
+    }
+
     value = cf->args->elts;
 
     if (ngx_strcmp(value[1].data, "X-Real-IP") == 0) {