Answer the question
In order to leave comments, you need to log in
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
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).
Maybe put before Apache and node.js, like nginx? Who will already decide which requests to send where?
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question