title: NGINX and Angular 2
body: <p>My current app users routes like this /myapp/, /myapp//, /myaapp/dept/</p>
  
  <p>My app is currently deployed in an internal http server with NGINX. The other server that accepts external traffic, also runs NGINX and forwards it to the internal server.</p>
  
  <p>I have add baseref=/myapp to the index.html as per documentation</p>
  
  <p>If the user goes to <a href="http://www.myexternalserver.com/myapp" rel="noreferrer">http://www.myexternalserver.com/myapp</a>, the app works perfectly. If the user is inside the page and clicks on an internal link like 
  <a href="http://www.myexternalserver.com/myapp/myparameter" rel="noreferrer">http://www.myexternalserver.com/myapp/myparameter</a>, it works. The url in the browser changes, the page is displayed as intended. I am guessing it's processed by Angular 2.</p>
  
  <p>Unfortunately when a user types in the url directly: <a href="http://www.myexternalserver.com/myapp/myparameter" rel="noreferrer">http://www.myexternalserver.com/myapp/myparameter</a>, I get a 404 error made by NGINX.</p>
  
  <p>I think I have to configure NGINX settings but I don't know how should modify NGINX's config or what to put in the sites-available/default file/</p>