K
K
kabzon2011-03-15 22:15:52
JavaScript
kabzon, 2011-03-15 22:15:52

apache + nodejs

Good afternoon.

Installed nodejs, server is listening on port 8000. Everything works fine with an http request to mydomain.ru:8000

Tell me what needs to be done so that when accessing nodejs.mydomain.ru, requests immediately (not mod_rewrite) go to mydomain.ru:8000

Thank you.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
K
kmike, 2011-03-16
@kabzon

Putting Apache before node.js is stupid, because a thread will hang on each connection, and then the meaning is in node.js.
nginx is good for everyone, but it doesn’t know how to proxy websockets - node.js, I suspect, for real time?
You can either try HAProxy (plug it in front of everyone), or leave node.js hanging on a different port (for example, if it is used for realtime stuff, and only js communicates with it, and html pages are given to something else - users do not need to go to this address).

P
Pavel Virsky, 2011-03-15
@Paaashka

Maybe put before Apache and node.js, like nginx? Who will already decide which requests to send where?

A
Anatoly, 2011-03-15
@taliban

configure the domain to mydomain.ru in the same way as mydomain.ru itself. Those. paths, ports, etc., everything is the same, only the server name is different.

I
Ivan, 2011-03-15
@iSage

httpd.apache.org/docs/2.0/mod/mod_proxy.html
But nginx is better.

F
Fedor Indutny, 2011-03-16
@donnerjack13589

github.com/nodejitsu/node-http-proxy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question