title: Why does docker nginx container not render react Route?
body: <p>I have been searching online for an answer to this but Im not finding the exact answer to my question. I have a react app. It is able to be built and run outside of a container. I now want to dockerize the react app. I feel like I have done this before without a problem but now it is causing me issues. I build the image and run it locally. The app on some level serves up correctly because the header component appears and works fine as well as the footer. The parts that dont show up are all inside react Route components however the html even appears on the dom. As I can see it there in the console. Even though I cannot see anything but the header and footer in the browser window. If I click in the right place in the browser window, I can even drag an image onto the desktop. I can then view the image fine. This seems super weird to me. I feel like it must be some sort of nginx/docker react-router config issue.</p>
  <p>Dockerfile</p>
  <pre><code>FROM nginx
  COPY build /usr/share/nginx/html
  COPY docker/default.conf /etc/nginx/conf.d/default.conf
  EXPOSE 80 80
  ENTRYPOINT [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]
  </code></pre>
  <p>default.conf file from docker folder</p>
  <pre><code>server {
   listen 80;
   server_name frontend;
  
   location / {
     # This would be the directory where your React app's static files are stored at
     root /usr/share/nginx/html;
     try_files $uri /index.html;
   }
  }
  </code></pre>
  <p>Any idea what is causing this problem and how to fix it would be greatly appreciated. Thanks.</p>