Can you share your full configuration? Normally when serving a node.js application, you would have a proxy_pass directive that would route the traffic to a local listener for the node application. Unless you want to serve static files alongside the node.js application, you should be able to just have a proxy_pass statement in the location / block, and not define the root, index or try_files directives. This will stop NGINX from attempting to serve any static files and just proxy all the request to the node.js app running locally.
Based on that config, I assume you are unable to access to your node.js app via nginx at all, correct? As I mentioned in my previous post, you are going to need to use proxy_pass to have nginx proxy the traffic to the node.js app. Assuming the node.js app is running locally, a simple config below should get it up and running:
Thank you for your reply. In my NGINX server there is only one application which is React application(Node). My NGINX server path and post is same for node application
NGINX is not a node.js server, but it is used as reverse proxy in front of a node.js application. If you look at the first blog post I shared, you can see that the nginx config is setup to route traffic to a node.js app running on localhost(127.0.0.1) on port 3000(ie proxy_pass http://127.0.0.1:3000/;). You will need to start a node application on the nginx node, and then configure nginx to proxy traffic to the application.
You are absolutely right for Node application. But my application like static files( html, css and js). When we build react application it serves a static bundle files.
In my cloud server I will just run NGINX. With in html folder I keep my static files.