Response.js application showing 404 not found on nginx server

I uploaded the react.js application to the server. I am using nginx server. The application is working fine. But when I go to another page and update, the site does not work. It shows 404 No error found.

How can i solve this.

Thank.

+17
source share
2 answers

react.js , react-router. , , http://a.com. http://a.com/b. . , url http://a.com/b , nginx, , , , 404.

, ( index.html) , nginx , . , nginx.conf sites-enabled

location / {
 try_files $uri /index.html;
}

nginx $uri, , index.html .

+56

, . location/{ try_files $uri/index.html; }

? . .

0

Source: https://habr.com/ru/post/1675393/


All Articles