net::ERR_CONNECTION_CLOSED on remote server when there are more than 7 sub-documents in mongo document net::ERR_CONNECTION_CLOSED on remote server when there are more than 7 sub-documents in mongo document nginx nginx

net::ERR_CONNECTION_CLOSED on remote server when there are more than 7 sub-documents in mongo document


Solution:

/etc/nginx/sites-enabled/default

# other code hereserver {   # other code here   # Increase http2 max sizes   http2_max_field_size 64k;   http2_max_header_size 64k;}

The reason I found this so hard to debug was because there was

no mention of the request in /var/log/nginx/error.log

and I didn't realize that nginx has the ability to be more verbose with its logging (duh)

So after changing /etc/nginx/sites-enabled/default to include

server {     error_log /var/log/nginx/error.log info;}

I saw

2017/05/08 16:17:04 [info] 3037#3037: *9 client exceeded http2_max_field_size limit while processing HTTP/2 connection, client: 89.15.159.19, server: 0.0.0.0:443

which was the error message I needed.