problem description:
1.react implements a dynamic proxy in package.json, as follows:
"proxy": "http://www.iamcrawler.cn:4000"
2. When you get up locally, you can access it.
3. After packaging with run build, put it in the corresponding directory and configure the nginx mapping. The nginx mapping is as follows:
server {
listen 3002 ;
-sharp Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
root /react/build;
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
4. But when accessing the server www.iamcrawler.cn:3002, the page can come out, but the interface throw 404 can not find the path, is there a problem with my nginx configuration?