0

A mobile safari client will do multiple duplicate GET requests to our server, I think this is due to pipelining: Safari Sends Two HTTP Req. Same Time/Socket.

Since our endpoint isn't idempotent, we have issues with this, as one of the requests will fail and the client gets erratic behavior.

I am trying to disable keepalive for only one endpoint in Nginx. Any ideas? The below gives me an nginx 404 error, and the log shows that nginx is trying to access a filesystem location: "/usr/share/nginx/html/duplicateget" with "No such file or directory" for the special endpoint /duplicateget. (I called it duplicateget as an example)

location / {
    ssi off;
    autoindex off;

    include uwsgi_params;
    uwsgi_param   Host               $host;
    uwsgi_param   X-Real-IP          $remote_addr;
    uwsgi_param   X-Forwarded-For    $proxy_add_x_forwarded_for;
    uwsgi_param   X-Forwarded-Proto  $http_x_forwarded_proto;

    uwsgi_pass cluster;

    location /duplicateget {
        keepalive_timeout 0;
    }
}
Community
  • 1
  • 1
TheJeff
  • 3,665
  • 34
  • 52

1 Answers1

0

This is not possible in nginx unfortunately. We simply no longer see duplicate requests when we set this globally:

keepalive_timeout 0;

Out upstream load balancers use haproxy without SSL termination, so the clients may be responding to this in an odd way, and our nginx config behind the scenes is acting strangely.

Long story short, still confused!

TheJeff
  • 3,665
  • 34
  • 52