<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Hello,<br></div><div class="gmail_extra"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><br></div><div class="gmail_quote">On Mon, Nov 17, 2014 at 7:16 AM, mex <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
map $http_user_agent $ios8_ua {<br>
default 0;<br>
"YOUR_REGEX_HERE" 1;<br>
}<br>
<br>
and then use the evil IF:<br>
<br>
if ($ios_ua) {<br>
keepalive_timout 0;<br>
}<br></blockquote><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">I would do even better by avoiding using 'if'</div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline"> at all:<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">map $http_user_agent $keepalive_timeout {<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline"> default 75s; # Put here the wanted default value (taken from <a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout" target="_blank">keepalive_timeout</a> docs)<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline"> *regex* 0;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline"> *for* 0;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline"> *blacklisted* 0;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline"> *user agents* 0;<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">}<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153);display:inline">keepalive_timeout $keepalive_timeout; # At http, server or location level, as docs state<br></div><div><div><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div></div></div><br></div></div>