I'm having some issues. I created a project which uses a client (react app) and a server (docker container running a flask server). I am trying to first setup the frontend because I also have a nextjs project running on the same server. I have the nextjs project to port 3000, and it is accessible there, but I followed the steps in the video for my react app and set the port to 5000 but its not working as intended.
great tutorial though the issue is with routes within the app i.e. this setup perfectly serves the landing page though if you visit any specific page by manually typing the URI, Nginx will show page not found 404. So, in your above example, if you try to say view any property details by clicking on the any link (house image), it will render house details though if you try to reload the page, you will get 404 as Nginx won't be able to find that html in your specified root. I'm still not sure how to get around this issue.
ok, found the answer here in SO post stackoverflow.com/questions/27928372/react-router-urls-dont-work-when-refreshing-or-writing-manually?page=1&tab=votes#tab-top Add this to your nginx.conf or ssl.conf (depending upon how your site is hosted). It fixes all these client side routing issues. location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.html break; } }
I need help. I have a React JS site...it was working fine...lastly I have changed my root password of my DigitalOcean Droplet. After changing the root password its showing an Error Message "502 Bad Getway" . Please help me how to resolve it?
Very clear way of explaining thanks
I'm having some issues. I created a project which uses a client (react app) and a server (docker container running a flask server). I am trying to first setup the frontend because I also have a nextjs project running on the same server. I have the nextjs project to port 3000, and it is accessible there, but I followed the steps in the video for my react app and set the port to 5000 but its not working as intended.
Please show how to do with ec2
great tutorial though the issue is with routes within the app i.e. this setup perfectly serves the landing page though if you visit any specific page by manually typing the URI, Nginx will show page not found 404. So, in your above example, if you try to say view any property details by clicking on the any link (house image), it will render house details though if you try to reload the page, you will get 404 as Nginx won't be able to find that html in your specified root. I'm still not sure how to get around this issue.
ok, found the answer here in SO post stackoverflow.com/questions/27928372/react-router-urls-dont-work-when-refreshing-or-writing-manually?page=1&tab=votes#tab-top
Add this to your nginx.conf or ssl.conf (depending upon how your site is hosted). It fixes all these client side routing issues.
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.html break;
}
}
Hey, did you get solution for it?
@@garimamody7535 see my above reply with SO thread for the solution.
I have the same problem, can you guide me to fix it?
@@vanhungnguyen7543 did you follow the Stackoverflow thread which I've posted above?
Good Description. Thanks.
I need help. I have a React JS site...it was working fine...lastly I have changed my root password of my DigitalOcean Droplet. After changing the root password its showing an Error Message "502 Bad Getway" . Please help me how to resolve it?
1:08
You providing a description in the link,
Or
You providing a link in the description
4:06 where is this file in ubuntu?
cd /etc/nginx
thanks man keep it up !
Hey 👋 , This is what I was looking for .. well explained with example ... can we do the same at EC2 instance ? .. please reply .. 🙏🙏🙏
Bhai reply kr de .... like krke kya hoga ?
Nicely explained
Thanx for the video
Thanks for the explanation
This is helpful
Where is the links ?
github.com/Aakashdeveloper/EDU_May_React_Eveng/tree/master/redux3