Answer the question
In order to leave comments, you need to log in
Setting up nginx ports for socket.io?
I do not know if I formulated the question correctly, but now I will try to explain the problem.
The server is running nginx, which redirects domains to different ports.
It was conceived like this: all domains will go to port 80, and the domains on which Node.js applications should run will go to ports 8080, 8000, 3000, 1337, etc., in order to run several node applications, and a site in PHP.
It looked like this:
server {
listen 80 default_server;
server_name localhost;
}
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://IP_ADRESS:1337;
}
}
Answer the question
In order to leave comments, you need to log in
try something like this
upstream first_server {
server 127.0.0.1:3000;
}
upstream second_server {
server 127.0.0.1:1337;
}
server {
listen 80;
server_name domain1.com;
location / {
proxy_pass http://first_server;
}
}
server {
listen 80;
server_name domain2.com;
location / {
proxy_pass http://second_server;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question