I\'ve set up Node.js and Nginx on my server. Now I want to use it, but, before I start there are 2 questions:
Node.js with Nginx configuration.
$ sudo nano /etc/nginx/sites-available/subdomain.your_domain.com
add the following configuration so that Nginx acting as a proxy redirect to port 3000 traffic from the server when we come from “subdomain.your_domain.com”
upstream subdomain.your_domain.com {
server 127.0.0.1:3000;
}
server {
listen 80;
listen [::]:80;
server_name subdomain.your_domain.com;
access_log /var/log/nginx/subdomain.your_domain.access.log;
error_log /var/log/nginx/subdomain.your_domain.error.log debug;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://subdomain.your_domain.com;
proxy_redirect off;
}
}