I have the following directive in my nginx.conf file:
map $http_user_agent $is_bot {
default 0;
~*(crawl|Google|Slurp|bingbot|tracker|click|parser|msnbot|msnbot|Gigabot|spider) 1;
}
This works just fine on a server running PHP 5.3 and nginx 1.1.19. It's causing an invalid option error when I try to start nginx on a different server running PHP 5.5 and nginx 1.4.6:
nginx: invalid option: "~*(crawl|Google|Slurp|bingbot|tracker|click|parser|msnbot|msnbot|Gigabot|spider)"
If I remove "|spider" the problem goes away. What could be wrong with this expression when it includes "spider"?
map $http_user_agent $is_bot {
default 0;
~*(crawl|Google|Slurp|bingbot|tracker|click|parser|msnbot|msnbot|Gigabot|spider) 1;
}
This works just fine on a server running PHP 5.3 and nginx 1.1.19. It's causing an invalid option error when I try to start nginx on a different server running PHP 5.5 and nginx 1.4.6:
nginx: invalid option: "~*(crawl|Google|Slurp|bingbot|tracker|click|parser|msnbot|msnbot|Gigabot|spider)"
If I remove "|spider" the problem goes away. What could be wrong with this expression when it includes "spider"?