nginx v0.7.64 on CentOS 5.3
We would like to be able to disable keepalive based on the User-Agent - specifically, we'd like to disable for MSIE 4.x,5.x,6.x
Even though the docs suggest it should work, the following config extract is rejected. We've tried various ways of setting the keepalive value - doesn't matter if we try keepalive_timeout or keepalive_requests - it won't let us change the value. Unfortunately we also can't do
[code]
keepalive_timeout $someVariable
[/code]
here's the extract
[code]
server {
listen 85;
server_name www.testingblah.com;
ancient_browser msie 4;
ancient_browser msie 5;
ancient_browser msie 6;
set $kvalue keepaliveon;
if ($ancient_browser){
set $kvalue keepaliveoff;
}
if ($kvalue = keepaliveon) {
keepalive_requests 50; //line 52
}
if ($kvalue = keepaliveoff) {
keepalive_requests 0;
}
location / {
proxy_pass http://WebHTTP;
}
}
[/code]
Error Message on startup is:
[emerg]: "keepalive_requests" directive is not allowed here in /data/apps/nginx/conf/nginx.conf:52
Any help - including alternative methods of achieving this requirement would be greatly appreciated.. we're looking for alternatives to lighttpd which is too buggy for us.