title: Use NGinx reverse proxy for create-react-app
body: <p>I'm trying to create a ReactJS app on a remote Ubuntu server. In order to test it in the browser I'm using the NGinx reverse-proxy features as this.</p>
  
  <pre><code>server {
      listen 80;
  
      server_name mentalg.com;
  
          location / {
                  proxy_pass http://172.31.23.249:5000;
                  proxy_http_version 1.1;
                  proxy_set_header Upgrade $http_upgrade;
                  proxy_set_header Connection 'upgrade';
                  proxy_set_header Host $host;
                  proxy_cache_bypass $http_upgrade;
          }
  
          location /client/ {
                  proxy_pass http://172.31.23.249:3000;
                  proxy_http_version 1.1;
                  proxy_set_header Upgrade $http_upgrade;
                  proxy_set_header Connection 'upgrade';
                  proxy_set_header Host $host;
                  proxy_cache_bypass $http_upgrade;
          }
  }
  </code></pre>
  
  <p>the 5000 port is for the REST <code>/api</code> end-points, all good here.</p>
  
  <p>But the 3000 port on which the development react server runs creates issues. </p>
  
  <p>The site opens as needed at <code>http://mentalg.com/client</code>, but inside the <code>index.html</code> there is a url for the script file to be executed as 
  <code>static/js/bundle.js</code> file. This file is served by the React dev server normally but NGinx won't see it. </p>
  
  <p>The url <code>static/js/bundle.js</code> is generated on the fly by the <code>create-react-app</code> dev server, can't control it. </p>
  
  <p>How do I modify further the nginx proxy to server the files from <code>static</code> folder correctly?</p>