Welcome! Log In Create A New Profile

Advanced

Disable keep_alive based on specific useragent

Robert Mueller
November 16, 2014 11:54PM
Due to a bug in iOS 8, I want to disable http keep-alive for all iOS 8
useragents for now.

https://github.com/AFNetworking/AFNetworking/issues/2314

I can't see a way to do this in nginx at the moment.


The docs for keep_alive disable only talk about msie6 and safari.

http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable

And indeed, checking the code shows that it's a bitfield with only a few
fixed possible values.


All our requests are proxied to a backend, and I obviously could easily
detect the user-agent on the backend, but I can't see any way to
indicate back to nginx that it should drop the connection to the client
after returning the response (e.g. there's no x-accel-disable-keepalive
or something like that).


I had a quick look through the code, and can't see anything obvious. No
configuration options, no upstream response headers, nothing even in the
nginx lua integration that could do this.

Am I missing something? It's a bit annoying that keepalive_disable can't
take an arbitrary regexp if people really want...

--
Rob Mueller
robm@fastmail.fm

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Disable keep_alive based on specific useragent

Robert Mueller November 16, 2014 11:54PM

Re: Disable keep_alive based on specific useragent

mex November 17, 2014 01:16AM

Re: Disable keep_alive based on specific useragent

B.R. November 17, 2014 01:44AM

Re: Disable keep_alive based on specific useragent

Robert Mueller November 17, 2014 11:26PM

Re: Disable keep_alive based on specific useragent

wandenberg November 18, 2014 06:26AM

Re: Disable keep_alive based on specific useragent

mex November 18, 2014 07:11AM

Re: Disable keep_alive based on specific useragent

Valentin V. Bartenev November 18, 2014 07:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready