Akward延迟将Apache的代理请求连接到node.js应用
在我的Ubuntu Server 10.04中,我正在运行一个示例node.js应用程序: var http = require("http"); function onRequest(request, response) { console.log("Request received."); response.writeHead(200, {"Content-Type": "text/html"}); response.write("Hello World"); response.end(); } http.createServer(onRequest).listen(3000); 它只是侦听端口3000上的请求,登录控制台此请求,然后向客户端发送HTTP “ Hello World” 目的是使该应用程序与Apache2共存。因此,经过一些研究,我以这种方式编辑了默认文件(/ etc / apache2 / sites-available / default): <VirtualHost *:80> ServerAdmin haj@myserver.com ServerName dev.myserver.com <Location /node> ProxyPassReverse http://127.0.0.1:3000/ ProxyPass http://127.0.0.1:3000/ </Location> <Proxy> Allow from all …