what did you start your react with? If you don't cooperate with webpack, you need to use Nginx?.
The
port is occupied, can't you just let one of them change for another? For example, the service port for starting react is changed to 3001
Nginx is used as a web server, and when you start it with crate-react-app, or when webpack, is a web server using node, there is bound to be a conflict between the two. Agent, it is recommended that the proxy, of webpack-dev-server can be used by Baidu without the help of Nginx.
first of all, you should understand a problem: after the development of a vue or react project, for example, instead of leaving the code on the server, npm run start. You should first build, the code through npm run build, and then you will find that there is an extra build folder. The folder contains the code we need to put on the server. Drag this compressed folder to the server. If you use nginx, then you just need to configure the static file, and then the other configurations are the same as yours. Of course, you need to have a /.
after the / api configuration file. If you need to access server resources when developing locally, you just need to add:
to the package.json folder.
has the subject been solved? Mine is now the same question, whether it is configured to forward the request or to report to 404 Magi Postman, you can request
.