Questions tagged «javascript»

4
如何通过UNIX套接字配置Nginx proxy_pass Node.js HTTP服务器?
我正在尝试配置Nginx服务器以通过UNIX域套接字连接到Node.js HTTP服务器。 Nginx配置文件: server { listen 80; location / { proxy_pass http://unix:/tmp/app.socket:/; } } (根据http://wiki.nginx.org/HttpProxyModule#proxy_pass) Node.js脚本: var http = require('http'); http.createServer(function(req, res) { console.log('received request'); req.end('received request\n'); }).listen('/tmp/app.socket'); 现在,当我尝试致电 curl http://localhost/ 我在curl中只得到502 Bad Gateway错误页面,而在Node.js进程上什么也没有。 难道我做错了什么? 编辑: 在尝试了Quanta的解决方案之后,该错误必定与Nginx配置有关,因为Node.js进程正确建立了与套接字的连接。 我还尝试通过这种方式配置Nginx: upstream myapp { server unix:/tmp/app.socket; } server { listen 80; location / …

3
选择服务器以运行Node.js的条件
我将使用什么标准来选择运行Node.js的服务器? 由于它很新,因此共享托管似乎是一个入门者。鉴于其工作原理,我将在生产机器方面看什么?最初,我的预算有限(每月不超过5至25美元)。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.