0

I am using keepalive_disable in nginx conf this requires for
Syntax: keepalive_disable none | browser ...; Default: keepalive_disable msie6; Context: http, server, location

Now i have two problems

  1. other than safari, msie6 i was not able to determine the browser like chrome, mozilla, firefox

  2. now i am making api calls from android and here is the access log dump and i want to disable keep alive for useragent android app and here is access log. what would i pass as a parameter in this case

    "POST /api/stores/store-times HTTP/1.1" 200 127 "//someshop (dot) com/" "Dalvik/2.1.0 (Linux; U; Android 5.1; V1-B18 Build/LMY47I)" "-" 0.042 "GET /api/stores/store-times HTTP/1.1" 200 127 "//someshop (dot) com/" "Dalvik/2.1.0 (Linux; U; Android 5.1; V1-B18 Build/LMY47I)" "-" 0.042 HTTP/1.1" 200 122 "-" "Dalvik/2.1.0 (Linux; U; Android 5.1; V1-B18 Build/LMY47I)" "-" 0.081

Shoaib
  • 1
  • and this is what it throws error when i used chrome75 -- Unit openresty.service has begun starting up. Jul 17 06:53:16 ip-172-19-39-146.ap-southeast-2.compute.internal openresty[22525]: Starting nginx: nginx: [emerg] invalid value "chrome75" in /usr/local/openresty/nginx/conf/nginx.conf:24 Subject: Unit openresty.service has failed – Shoaib Jul 17 '19 at 07:16
  • http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" ' '$request_time'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 180; types_hash_max_size 2048; client_max_body_size 15M; keepalive_disable msie6; – Shoaib Jul 17 '19 at 07:16
  • what will be there parameters for the api calls in android app and also for browsers other than safari and msie6. – Shoaib Jul 17 '19 at 07:17

1 Answers1

0

It is just not possible to disable keeping connection alive for other user-agents. It is possible to disable keeping connection only for safari and msi6.

You can see reason for it here: https://github.com/nginx/nginx/blob/f0a5ce136d8c0492123b16436467d367ed484d28/src/http/ngx_http_core_module.c#L140

JiriHnidek
  • 101
  • 4