Can someone please help on what the issue is here.
I have a React web app hosted on Azure Web App. It has been deployed successful.
My problem is, if, for example, I go to the site on myweb.azurewebsites.net
it loads well. And if I click on a button like the "signin" button it redirects me to myweb.azurewebsites.net/signin
.
However, if I manually type in myweb.azurewebsites.net/signin
into the browser, it gives an "Nginx not found" error.
Can someone help on what the issue is. I suspects it’s between Azure and/or Nginx.
2
Answers
I discovered that I didn't add an Nginx conf file and copy it into the Nginx Docker container. When I did that, it works fine.
Nginx not found 404 error means Nginx can’t find the resources your web browser asks for.
To resolve "Nginx not found 404 error", please find below workarounds if helpful:
Workaround1:
Make sure your
nginx.conf
file as shown below:Workaround2:
If Workaround1 does not work, try changing the
location segment
as belowWorkaround3:
Configure the startup command on "Settings > General settings > Startup Command".
Change the path to your build path.
To redirect all queries, use the
--spa
option:Workaround4:
In the
nginx.conf
file, try commenting-out thedisable_symlinks on
line or changing it todisable_symlinks off
.