worker_connections are not enough

Old question, but i had the same issue and the accepted answer didnt work for me.

I had to increase the number of worker_connections, as stated here.

/etc/nginx/nginx.conf

events {
    worker_connections 20000;
}

Not quite enough info to say definitively, but based on the config you've provided, it looks like you have loop. You're proxying the requests to localhost:80, but NGINX is most likely listening on port 80. So, NGINX is connecting to itself over and over, hence the errors about too many open files.

Also, Kibana doesn't have any server-side code, so proxy_pass isn't appropriate here. Something like the following should be enough:

root /var/www/
location /kibana-3.1.2 {
    try_files $uri $uri/ =404;
}

With that being said, if you intend for this to be accessible from the public internet, you should protect it with a password and you should use proxy_pass in front of elasticsearch to control what requests can be made to it. But that's a different story :)