Here is my nginx error.log
in debug mode for that particular request in case it helps:
2018/03/20 12:29:20 [debug] 6210#6210: *20 accept: xxx.xxx.xxx.xxx:37028 fd:3
2018/03/20 12:29:20 [debug] 6210#6210: *20 event timer add: 3: 60000:1126997996
2018/03/20 12:29:20 [debug] 6210#6210: *20 reusable connection: 1
2018/03/20 12:29:20 [debug] 6210#6210: *20 epoll add event: fd:3 op:1 ev:80002001
2018/03/20 12:29:20 [debug] 6210#6210: *20 http check ssl handshake
2018/03/20 12:29:20 [debug] 6210#6210: *20 http recv(): 1
2018/03/20 12:29:20 [debug] 6210#6210: *20 https ssl handshake: 0x16
2018/03/20 12:29:20 [debug] 6210#6210: *20 tcp_nodelay
2018/03/20 12:29:20 [debug] 6210#6210: *20 SSL server name: "sync.example.com"
2018/03/20 12:29:20 [debug] 6210#6210: *20 SSL NPN advertised
2018/03/20 12:29:20 [debug] 6210#6210: *20 SSL_do_handshake: -1
2018/03/20 12:29:20 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:20 [debug] 6210#6210: *20 reusable connection: 0
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL handshake handler: 0
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_do_handshake: 1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL: TLSv1.2, cipher: "ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD"
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL reused session
2018/03/20 12:29:21 [debug] 6210#6210: *20 reusable connection: 1
2018/03/20 12:29:21 [debug] 6210#6210: *20 http wait request handler
2018/03/20 12:29:21 [debug] 6210#6210: *20 posix_memalign: 003F3EB0:256 @16
2018/03/20 12:29:21 [debug] 6210#6210: *20 malloc: 003FBF08:1024
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 free: 003FBF08
2018/03/20 12:29:21 [debug] 6210#6210: *20 http wait request handler
2018/03/20 12:29:21 [debug] 6210#6210: *20 malloc: 003FBF08:1024
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 free: 003FBF08
2018/03/20 12:29:21 [debug] 6210#6210: *20 http wait request handler
2018/03/20 12:29:21 [debug] 6210#6210: *20 malloc: 0044F2E8:1024
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 free: 0044F2E8
2018/03/20 12:29:21 [debug] 6210#6210: *20 http wait request handler
2018/03/20 12:29:21 [debug] 6210#6210: *20 malloc: 0044F2E8:1024
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 free: 0044F2E8
2018/03/20 12:29:21 [debug] 6210#6210: *20 http wait request handler
2018/03/20 12:29:21 [debug] 6210#6210: *20 malloc: 0044F2E8:1024
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 free: 0044F2E8
2018/03/20 12:29:21 [debug] 6210#6210: *20 http wait request handler
2018/03/20 12:29:21 [debug] 6210#6210: *20 malloc: 0044F2E8:1024
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 free: 0044F2E8
2018/03/20 12:29:21 [debug] 6210#6210: *20 http wait request handler
2018/03/20 12:29:21 [debug] 6210#6210: *20 malloc: 0044F2E8:1024
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: 1024
2018/03/20 12:29:21 [debug] 6210#6210: *20 reusable connection: 0
2018/03/20 12:29:21 [debug] 6210#6210: *20 posix_memalign: 0044F6F0:4096 @16
2018/03/20 12:29:21 [debug] 6210#6210: *20 http process request line
2018/03/20 12:29:21 [debug] 6210#6210: *20 http request line: "POST /my-inkdrop-notes/_bulk_docs HTTP/1.1"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http uri: "/my-inkdrop-notes/_bulk_docs"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http args: ""
2018/03/20 12:29:21 [debug] 6210#6210: *20 http exten: ""
2018/03/20 12:29:21 [debug] 6210#6210: *20 http process request header line
2018/03/20 12:29:21 [debug] 6210#6210: *20 http header: "Authorization: Basic SECRET=="
2018/03/20 12:29:21 [debug] 6210#6210: *20 http header: "Accept: application/json"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http header: "Content-Type: application/json"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http header: "host: sync.example.com:6984"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http header: "content-length: 8577673"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http header: "Connection: close"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http header done
2018/03/20 12:29:21 [debug] 6210#6210: *20 event timer del: 3: 1126997996
2018/03/20 12:29:21 [debug] 6210#6210: *20 generic phase: 0
2018/03/20 12:29:21 [debug] 6210#6210: *20 rewrite phase: 1
2018/03/20 12:29:21 [debug] 6210#6210: *20 test location: "/"
2018/03/20 12:29:21 [debug] 6210#6210: *20 test location: ~ "^/(.*)/(_changes|_bulk_docs)"
2018/03/20 12:29:21 [debug] 6210#6210: *20 using configuration "^/(.*)/(_changes|_bulk_docs)"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http cl:8577673 max:20971520
2018/03/20 12:29:21 [debug] 6210#6210: *20 rewrite phase: 3
2018/03/20 12:29:21 [debug] 6210#6210: *20 post rewrite phase: 4
2018/03/20 12:29:21 [debug] 6210#6210: *20 generic phase: 5
2018/03/20 12:29:21 [debug] 6210#6210: *20 generic phase: 6
2018/03/20 12:29:21 [debug] 6210#6210: *20 generic phase: 7
2018/03/20 12:29:21 [debug] 6210#6210: *20 access phase: 8
2018/03/20 12:29:21 [debug] 6210#6210: *20 access phase: 9
2018/03/20 12:29:21 [debug] 6210#6210: *20 access phase: 10
2018/03/20 12:29:21 [debug] 6210#6210: *20 post access phase: 11
2018/03/20 12:29:21 [debug] 6210#6210: *20 generic phase: 12
2018/03/20 12:29:21 [debug] 6210#6210: *20 generic phase: 13
2018/03/20 12:29:21 [debug] 6210#6210: *20 http client request body preread 789
2018/03/20 12:29:21 [debug] 6210#6210: *20 http request body content length filter
2018/03/20 12:29:21 [debug] 6210#6210: *20 http body new buf t:1 f:0 0044F3D3, pos 0044F3D3, size: 789 file: 0, size: 0
2018/03/20 12:29:21 [debug] 6210#6210: *20 malloc: 004506F8:8192
2018/03/20 12:29:21 [debug] 6210#6210: *20 http read client request body
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: 8192
2018/03/20 12:29:21 [debug] 6210#6210: *20 http client request body recv 8192
2018/03/20 12:29:21 [debug] 6210#6210: *20 http body new buf t:1 f:0 004506F8, pos 004506F8, size: 8192 file: 0, size: 0
2018/03/20 12:29:21 [debug] 6210#6210: *20 http write client request body, bufs 00450420
2018/03/20 12:29:21 [debug] 6210#6210: *20 add cleanup: 004505D0
2018/03/20 12:29:21 [debug] 6210#6210: *20 hashed path: /var/cache/nginx/client_temp/0000000001
2018/03/20 12:29:21 [debug] 6210#6210: *20 temp fd:12
2018/03/20 12:29:21 [warn] 6210#6210: *20 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: xxx.xxx.xxx.xxx, server: sync.example.com, request: "POST /my-inkdrop-notes/_bulk_docs HTTP/1.1", host: "sync.example.com:6984"
2018/03/20 12:29:21 [debug] 6210#6210: *20 writev: 12, 8981, 0
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: 7168
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 http client request body recv 7168
2018/03/20 12:29:21 [debug] 6210#6210: *20 http client request body rest 8568692
2018/03/20 12:29:21 [debug] 6210#6210: *20 event timer add: 3: 60000:1126998378
2018/03/20 12:29:21 [debug] 6210#6210: *20 http finalize request: -4, "/my-inkdrop-notes/_bulk_docs?" a:1, c:2
2018/03/20 12:29:21 [debug] 6210#6210: *20 http request count:2 blk:0
2018/03/20 12:29:21 [debug] 6210#6210: *20 http run request: "/my-inkdrop-notes/_bulk_docs?"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http read client request body
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 http client request body recv -2
2018/03/20 12:29:21 [debug] 6210#6210: *20 http client request body rest 8568692
2018/03/20 12:29:21 [debug] 6210#6210: *20 event timer: 3, old: 1126998378, new: 1126998396
2018/03/20 12:29:21 [debug] 6210#6210: *20 http run request: "/my-inkdrop-notes/_bulk_docs?"
2018/03/20 12:29:21 [debug] 6210#6210: *20 http read client request body
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:21 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:21 [debug] 6210#6210: *20 http client request body recv -2
2018/03/20 12:29:21 [debug] 6210#6210: *20 http client request body rest 8568692
2018/03/20 12:29:21 [debug] 6210#6210: *20 event timer: 3, old: 1126998378, new: 1126998402
[...]
2018/03/20 12:29:31 [debug] 6210#6210: *20 http run request: "/my-inkdrop-notes/_bulk_docs?"
2018/03/20 12:29:31 [debug] 6210#6210: *20 http read client request body
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body recv -2
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body rest 6946676
2018/03/20 12:29:31 [debug] 6210#6210: *20 event timer: 3, old: 1127008359, new: 1127008651
2018/03/20 12:29:31 [debug] 6210#6210: *20 http run request: "/my-inkdrop-notes/_bulk_docs?"
2018/03/20 12:29:31 [debug] 6210#6210: *20 http read client request body
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body recv -2
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body rest 6946676
2018/03/20 12:29:31 [debug] 6210#6210: *20 event timer del: 3: 1127008359
2018/03/20 12:29:31 [debug] 6210#6210: *20 event timer add: 3: 60000:1127008700
2018/03/20 12:29:31 [debug] 6210#6210: *20 http run request: "/my-inkdrop-notes/_bulk_docs?"
2018/03/20 12:29:31 [debug] 6210#6210: *20 http read client request body
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_read: -1
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_get_error: 2
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body recv -2
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body rest 6946676
2018/03/20 12:29:31 [debug] 6210#6210: *20 event timer: 3, old: 1127008700, new: 1127008702
2018/03/20 12:29:31 [debug] 6210#6210: *20 http run request: "/my-inkdrop-notes/_bulk_docs?"
2018/03/20 12:29:31 [debug] 6210#6210: *20 http read client request body
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_read: 1024
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body recv 1024
2018/03/20 12:29:31 [debug] 6210#6210: *20 http body new buf t:1 f:0 004506F8, pos 004506F8, size: 8192 file: 0, size: 0
2018/03/20 12:29:31 [debug] 6210#6210: *20 http write client request body, bufs 004504D0
2018/03/20 12:29:31 [debug] 6210#6210: *20 write: 12, 004506F8, 8192, 1630997
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_read: 8192
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body recv 8192
2018/03/20 12:29:31 [debug] 6210#6210: *20 http body new buf t:1 f:0 004506F8, pos 004506F8, size: 8192 file: 0, size: 0
2018/03/20 12:29:31 [debug] 6210#6210: *20 http write client request body, bufs 004504D0
2018/03/20 12:29:31 [debug] 6210#6210: *20 write: 12, 004506F8, 8192, 1639189
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_read: 7168
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_read: 0
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_get_error: 5
2018/03/20 12:29:31 [debug] 6210#6210: *20 peer shutdown SSL cleanly
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body recv 7168
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body rest 6930292
2018/03/20 12:29:31 [debug] 6210#6210: *20 http client request body recv 0
2018/03/20 12:29:31 [info] 6210#6210: *20 client prematurely closed connection, client: xxx.xxx.xxx.xxx, server: sync.example.com, request: "POST /my-inkdrop-notes/_bulk_docs HTTP/1.1", host: "sync.example.com:6984"
2018/03/20 12:29:31 [debug] 6210#6210: *20 http finalize request: 400, "/my-inkdrop-notes/_bulk_docs?" a:1, c:1
2018/03/20 12:29:31 [debug] 6210#6210: *20 http terminate request count:1
2018/03/20 12:29:31 [debug] 6210#6210: *20 http terminate cleanup count:1 blk:0
2018/03/20 12:29:31 [debug] 6210#6210: *20 http posted request: "/my-inkdrop-notes/_bulk_docs?"
2018/03/20 12:29:31 [debug] 6210#6210: *20 http terminate handler count:1
2018/03/20 12:29:31 [debug] 6210#6210: *20 http request count:1 blk:0
2018/03/20 12:29:31 [debug] 6210#6210: *20 http close request
2018/03/20 12:29:31 [debug] 6210#6210: *20 http log handler
2018/03/20 12:29:31 [debug] 6210#6210: *20 run cleanup: 004505D0
2018/03/20 12:29:31 [debug] 6210#6210: *20 file cleanup: fd:12
2018/03/20 12:29:31 [debug] 6210#6210: *20 free: 004506F8
2018/03/20 12:29:31 [debug] 6210#6210: *20 free: 0044F6F0, unused: 98
2018/03/20 12:29:31 [debug] 6210#6210: *20 close http connection: 3
2018/03/20 12:29:31 [debug] 6210#6210: *20 SSL_shutdown: 1
2018/03/20 12:29:31 [debug] 6210#6210: *20 event timer del: 3: 1127008700
2018/03/20 12:29:31 [debug] 6210#6210: *20 reusable connection: 0
2018/03/20 12:29:31 [debug] 6210#6210: *20 free: 0044F2E8
2018/03/20 12:29:31 [debug] 6210#6210: *20 free: 0040DAA0, unused: 8
2018/03/20 12:29:31 [debug] 6210#6210: *20 free: 003F3EB0, unused: 184
Update: Nginx version details for above error.log on Raspberry Pi
pi@raspberrypi ~ $ nginx -V
nginx version: nginx/1.13.9
built by gcc 4.9.2 (Raspbian 4.9.2-10+deb8u1)
built with OpenSSL 1.0.1t 3 May 2016
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_v2_module --with-ipv6 --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-debug
Update 2: Updating nginx to use OpenSSL 1.1.0g (same as Fedora on localhost) does not solve the problem. Still getting the same SSL_get_error: 5
just before the connection is closed.