Answer the question
In order to leave comments, you need to log in
How to host multiple sites on the same ip?
There is VDS. 2 applications on Node.js are spinning. In front of them is Nginx. There is a domain with an SSL certificate, and now one application is available through the domain, and the second is available via IP:PORT. I bought a domain for the second application (no SSL yet) and I'm trying to update the Nginx config, but something doesn't take off...
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
}
http {
sendfile on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log crit;
gzip on;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
server {
listen 80;
server_name domen1.ru www.domen1.ru;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name domen1.ru www.domen1.ru;
..........
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
...........
}
}
# И вот эта секция не работает
server {
listen 80;
server_name domen2.ru www.domen2.ru;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
...........
}
}
}
Answer the question
In order to leave comments, you need to log in
DNS has not been updated, so it does not work =) Thank you all for your comments.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question