I'm using nginx (1.9.3) + php-fpm (via unix sockets) with another nginx as a reverse proxy. And rarely (1 out of ~100 requests) I get net::ERR_INCOMPLETE_CHUNKED_ENCODING
during OPTIONS
XHR request from one subdomain to another (cloud.example.com to api.example.com). This OPTIONS request sent automatically before POST. Chrome Version 50.0.2661.94 (64-bit) OS X
Reverse proxy:
location / {
proxy_pass http://xxx.xxx.xxx.xxx:80;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
}
Request headers:
OPTIONS /my/request/uri HTTP/1.1
Host: api.example.com
Connection: keep-alive
Access-Control-Request-Method: POST
Origin: https://subdomain.example.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36
Access-Control-Request-Headers: accept, content-type
Accept: */*
Referer: https://subdomain.example.com/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,ru;q=0.6
Response headers:
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 13 May 2016 06:39:05 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Access-Control-Allow-Origin: https://subdomain.example.com
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type
Content-Encoding: gzip
Strict-Transport-Security: max-age=31536000; includeSubdomains;
My guess is that this could be caused by timeouts, but I doubt there are milliseconds timeouts somewhere. The screenshot below is from a Chrome developer tools network tab filtered by the same request repeated many times.
Any help is much appreciated!