Apacheのプロキシリクエストをnode.jsアプリに接続するためのAkward遅延
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 </Proxy> …