I managed to get it working by adding nginx to the main user group node:
gpasswd -a nginx node
And then start the express server using the following:
// Create the server fs.stat(listen, function(err) { if (!err) { fs.unlinkSync(sock); } http.createServer(app).listen(sock, function(){ fs.chmodSync(sock, '775'); console.log('Express server listening on ' + listen); }); });
I really donβt feel that this is the right decision, just a hack. The express was not created with the removal and configuration of perms files, and this especially makes me add the user nginx to the main group of the user node. If there was ever a compromise in the nginx account, an attacker could have access to the entire source of the application, as well as try endless attacks on the code using a socket. The best I can do is set umask to 077 for the node user and try to get 100% coverage with chmod 600 for each file and chmod 700 in each directory or set the group to a default value for the user at all.
However, I would still appreciate any ideas.
Bobby
source share