title: React router works only with /#/ within the URL, otherwise error 404 on a Ubuntu server
body: <p>My app is deployed (<code>npm run build</code>)  on a Ubuntu server.
  I'm using a Router in my App and when clicking on a link (i.e contact-us), it's working - user is redirected to the page.</p>
  <p>But if I'm trying to access to the <strong>contact-us</strong> page directly (http://my_ip/contact-us), I get a 404 response.</p>
  <p><strong>Note:</strong> If I add a /#/ to the url, it does work! i.e http://my_ip/#/contact-us.</p>
  <p>Some code:</p>
  <pre><code> import { BrowserRouter as Router, Route, Switch } from &quot;react-router-dom&quot;;
      import history from './history';
      
          render() {
              return (
                &lt;div className=&quot;page&quot;&gt;
                  &lt;Router history={history}&gt;
                  &lt;Header /&gt;
                    &lt;Switch&gt;
                      &lt;Route path=&quot;/combination/:some_id&quot; exact component={SomePage} /&gt;
                      &lt;Route path=&quot;/&quot; exact component={Home} /&gt;
                      &lt;Route path=&quot;/contact-us&quot; exact component={ContactUs} /&gt;
                    &lt;/Switch&gt;
                  &lt;/Router&gt;
                &lt;/div&gt;
              )
            }
  </code></pre>
  <p>History.js:</p>
  <pre><code>import { createBrowserHistory } from 'history';
  
  export default createBrowserHistory();
  </code></pre>
  <p><strong>Update</strong>
  The problem was Nginx configuration: Adding the following line solved it.</p>
  <pre><code>try_files $uri $uri/ /index.html;
  </code></pre>
  <p>But now the problem is for the first Route (SomePage),</p>
  <p>I just see a blank page!  No error 404. what does it mean?</p>