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.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
You could try my nginx configuration file Config model1:
# if you need to change from http to https
server {
if ($host = yourhost.net) {
return 301 https://$host$request_uri;
}
listen 80;
listen [::]:80;
server_name yourhost.net;
return 302 https://$server_name$request_uri;
}
# stuff here
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourhost.net;
location / {
alias /var/www/html/;
try_files $uri $uri @fwdbackend;
}
location @fwdbackend {
proxy_pass http://10.10.0.3:81;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
real_ip_header CF-Connecting-IP; # Cloudflare
}
Explanation:
the nginx server access file on localhost at /var/www/html/
its using alias so when http://yourhost.net/assets/x.js will looking into /var/www/html/assets/x.js
and when there’s no file match with the user request it’ll pass to @fwdbackend (which pass the user request to 10.10.0.3:81 [nodejs server])
Config model2"
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourhost.net;
location /assets {
alias /var/www/html/assets/;
try_files $uri $uri =404;
}
location / {
proxy_pass http://10.10.0.3:81;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
real_ip_header CF-Connecting-IP; # Cloudflare
}