title: Deploy React with Nginx failed to load resources
body: <p>I'm trying to deploy a react app with nginx reverse proxy. </p>
  
  <p>My server configuration block (/etc/nginx/sites-available/app2.conf) is as follow:</p>
  
  <pre><code>server {
    listen 80;
    listen[::]:80;
    root/srv/app2/build;
    index index.html index.html;
    server_name _;
  
    location / {
      proxy_pass http://localhost:3001/;
      try_files $uri $uri/ =404;
    }
  }
  </code></pre>
  
  <p>I'm using a docker to run the react app with port 3001 exposed. 
  I tried to use curl to see if it works. The curl command works as expected. </p>
  
  <pre><code>curl http://localhost:3001
  </code></pre>
  
  <p>However, when i tried to run in my web browser i got the following error:</p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of 404 (Not Found) main.8ea061ea.chunk.css </p>
    
    <p>Failed to load resource: the server responded with a status of 404
    (Not Found) main.dcd07bc1.chunk.js</p>
    
    <p>Failed to load resource: the server responded with a status of 404
    (Not Found) 1.a6f3a221.chunk.js </p>
    
    <p>Failed to load resource: the server responded with a status of 404
    (Not Found) main.dcd07bc1.chunk.js </p>
    
    <p>Failed to load resource: the server responded with a status of 404
    (Not Found) main.8ea061ea.chunk.css</p>
  </blockquote>
  
  <p>It seems that it failed to load all the static files (.css &amp; .js) files. 
  Does anybody know how to resolve this?</p>