title: AngularJS application shows file structure when I refresh
body: <p>I currently have an AngularJS front end for my application.  I have used ui-router for transitioning between states.</p>
  
  <p>When I enable HTML5mode and refresh the page, the application ends up serving the file structure, rather than the refreshed page.</p>
  
  <p>Please tell me what I'm doing wrong. </p>
  
  <p>I have given below a few snippets of my code:</p>
  
  <p>These are my state definitions:</p>
  
  <pre><code>.state('home', {
             url: '/home',
             views:{
               'home':{
                 templateUrl: 'home/home.html',
                 controller : 'HomeCtrl',
                 controllerAs : 'homeCtrl'
               }
             },
             access:{restricted: true}
         })
  
  
         .state('quote',{
           url : '/quote',
           views: {
             'quote' : {
               templateUrl : 'quote/quote.html',
               controller : 'QuoteCtrl',
               controllerAs : 'quoteCtrl'
             }
           },
           access:{restricted: true}
         })
         .state('profile',{
           url : '/profile',
           views: {
             'profile' : {
               templateUrl : 'profile/userprofile.html',
               controller : 'ProfileCtrl',
               controllerAs : 'profileCtrl'
             }
           },
           access:{restricted: true}
         })
  </code></pre>
  
  <p>Snippet from my app.js where i enable the html5mode:</p>
  
  <pre><code>$locationProvider.html5Mode({
         enabled: true,
         requireBase: false
         });
  </code></pre>
  
  <p>snippet from my index.html:</p>
  
  <pre><code>&lt;base href="/"/&gt;
  </code></pre>
  
  <p>I have also attached a picture of the file structure I see when I hit F5.</p>
  
  <p>Server background: I run my website on an AWS server and use NGINX + npm.</p>
  
  <p>Regards,
  Galeej</p>
  
  <p><a href="https://i.stack.imgur.com/ajA4n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ajA4n.png" alt="Error I get when i hit refresh from my home screen"></a></p>