How to configure nodejs project and reactjs project for nginx

1,
is accessible for static pages when I configure only static directories.
when doing development, the server port is 8999, and the project port is 3000.
now deploy to linux, do a simple proxy with nginx
2, only set

location / {
    root   html;
    index  index.html;
    -sharp url index.html
    try_files $uri /index.html;
}

you can visit the static page
3
clipboard.png
Nginx

clipboard.png

clipboard.png
Resources

when I deploy port 8999 of the agent nodejs according to the tutorial.
Mar.02,2021

you shouldn't forward /. Is the daemon / api that forwards to port 8999


8999 running?


The

server-side proxy should be configured under / .

you should configure another agent:

/api {
    proxy_pass  http://localhost:8999;
}
Menu