#nginx #react #tricks

How to remove 404 in internal pages in React Nginx

When you make a refresh in a react app in any page apart from root, if you are facing 404 add the below line of code in your nginx configuration file.

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


Comments

Feel Free to Comment

We'll never share your email with anyone else.
mohammed-samgan-khan

Hi, I am Samgan, I excel at solving complex problems involving logic and step by step breakdown of the problem. Besides, to develop complex algorithms, I specialise in problem framing, systems design, and product development strategy. Sometimes I also enjoy public speaking.  

I am also the creator of penit.ink, a site which provides young writers with a free hand place to show their creation to the world. Irrespective of the niche, if you write this place is defiantly for you.