ReJeCtAll / naxsi

Automatically exported from code.google.com/p/naxsi
Other
0 stars 0 forks source link

using uninitialized "naxsi_flag_learning" variable #56

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
if you set the naxsi_flag_learning in a vhost, your error log gets filled up 
with messages like this:

2013/01/06 22:46:40 [warn] 9147#0: *4 using uninitialized "naxsi_flag_learning" 
variable, client: 127.0.0.1, server: _, request: "GET / HTTP/1.1", host: 
"127.0.0.1"
2013/01/06 22:51:40 [warn] 9147#0: *7 using uninitialized "naxsi_flag_learning" 
variable, client: 127.0.0.1, server: _, request: "GET / HTTP/1.1", host: 
"127.0.0.1"
2013/01/06 22:56:40 [warn] 9147#0: *8 using uninitialized "naxsi_flag_learning" 
variable, client: 127.0.0.1, server: _, request: "GET / HTTP/1.1", host: 
"127.0.0.1"

Original issue reported on code.google.com by hel...@gmail.com on 6 Jan 2013 at 11:00

GoogleCodeExporter commented 8 years ago
It seems that you have set naxsi_flag_learning in a location. It doesn't work.
You have to set it outside a location. For example :
server {

set naxsi_flag_learning 1;

location / {
#do whatever you want
}

}

Original comment by sephirot...@gmail.com on 6 Jan 2013 at 11:09

GoogleCodeExporter commented 8 years ago
no my config looks like this

server {
    listen 80;

    server_name  _;

    include /etc/nginx/proxy_params;

     set $naxsi_flag_learning 1;

    location /robots.txt {
        alias /var/www/stuff/norobots.txt;
    }
    location ~ /\. {
        deny all;
    }
    location / {
        proxy_pass        http://localhost:8100;
        include    /etc/nginx/naxsi.rules;
    }
}

But I have several vhosts (servers), I guess the problem might be that once you 
use this variable you have to define it in every vhost?

Original comment by hel...@gmail.com on 7 Jan 2013 at 9:30

GoogleCodeExporter commented 8 years ago
Hello,

Actually, the bug happens only if your error_log are in debug AND you have 
multiple server blocks, with at least one of them with naxsi enabled, but not 
all of them initializing your variable. I do not see any workaround yet (except 
removing debug flag from your error_log).

Original comment by ori...@gmail.com on 7 Jan 2013 at 5:57

GoogleCodeExporter commented 8 years ago

Original comment by ori...@gmail.com on 17 Jan 2013 at 7:35

GoogleCodeExporter commented 8 years ago

Original comment by ori...@gmail.com on 13 Mar 2013 at 8:56