Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi. I wrote two differents apps in nodejs that run in two different ports. I would like to know how to configure nginx to redirect traffic to those apps.
The first app runs in the port 3000 and it is working fine. When the client type the url https://celr.com.br the traffic is going to the website.
The second app runs in the port 3001 and when the client tyep the url http://votolegal.celr.com.br it is directed to the same website, not to my second app.
The nginx conf file to the first domain is:
server {
root /var/www/celr.com.br/html;
index index.js index.html index.htm index.nginx-debian.html;
server_name celr.com.br www.celr.com.br;
location / {
# try_files $uri $uri/ =404;
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/celr.com.br/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/celr.com.br/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}server {
if ($host = www.celr.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = celr.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name celr.com.br www.celr.com.br;
return 404; # managed by Certbot
}
The nginx conf file to the domain votolegal.celr.com.br is:
server {
listen 80;
listen [::]:80;
server_name votolegal.celr.com.br;
root /var/www/celr.com.br/html;
location / {
proxy_pass http://localhost:3001;
}
}
I have already read a lot of documents showing how to configure that.
I don´t know what I am doing wrong.
Could someone help me?
Thanks in advance
Claudinei
ebeecroft
68aa2215160846bca0a00f952c5fdc
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
032f50ee7f7d489db3b05e204fe139
032f50ee7f7d489db3b05e204fe139
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e