Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Using MAP directive

$
0
0
I'm trying to use the "map" directive to test for a set on know ip's as crawlers, to prevent their requests form being logged.

in the http section
map $realip_remote_addr $crawlerip {

default 0;

192.168.10.10 1;
192.168.10.6 1;
192.168.10.5 1;
}
(not the real ip's of course)

in the server section
location / {

if ($crawlerip = 1) {
access_log off;
}
<do something>
}

Not sure if i'm using the directive correctly. Connections are proxied from varnish.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>