I am running node.js (0.8.20 and 0.9.10) on a Windows 2012 server. I have been running without problems for several weeks. It was without Nginx (1.2.6) in front. With nginx, the front is configured like this:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream dem2 {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name dem2.cz dem2;
access_log /nginx-1.2.6/logs/dem2.log;
location / {
proxy_pass http://dem2/;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
}
}
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
}
}
In requests, I accidentally get this error in the node.js app:
events.js:69
throw arguments[1]; // Unhandled 'error' event
^
Error: socket hang up
at createHangUpError (http.js:1383:15)
at ServerResponse.OutgoingMessage._writeRaw (http.js:499:26)
at ServerResponse.OutgoingMessage._send (http.js:466:15)
at ServerResponse.OutgoingMessage.end (http.js:911:18)
at SendStream.notModified (C:\dem2cz_node_app\node_modules\express\node_modules\send\lib\send.js:223:7)
at SendStream.send (C:\dem2cz_node_app\node_modules\express\node_modules\send\lib\send.js:353:17)
at SendStream.pipe (C:\dem2cz_node_app\node_modules\express\node_modules\send\lib\send.js:322:10)
at Object.oncomplete (fs.js:93:15)
Process finished with exit code 1
I suspect that I have something incorrectly configured in Nginx, but I'm sure I don't know what the hell it could be. Can anyone advise please?
I can publish the node.js code if you want, but nothing has been invented, just 100 lines of express application for serving static AngularJS files with the ability to serve HTML generated in PhantomJS when there is a bot.