Angularjs version 1.3.14, ui-router version 0.2.15, html5mode enabled. When I try http://localhost/firsttime it redirects to http://localhost as fallback
Here is app.js
'use strict';
// Declare app level module which depends on views, and components
angular.module('tt', [
'ngRoute',
'tt.home',
'tt.firsttime',
'ui.router'
])
.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
// Routes
$routeProvider.otherwise({
redirectTo: '/'
});
// set HTML5 history API
$locationProvider.html5Mode(true);
}]);
Here is firsttime.js
// create our angular app and inject ngAnimate and ui-router
// =============================================================================
angular.module('tt.firsttime', ['ui.router'])
// configuring our routes
// =============================================================================
.config(['$stateProvider', '$urlRouterProvider', '$routeProvider', function($stateProvider, $urlRouterProvider, $routeProvider) {
// catch all route
// send users to the form page
$urlRouterProvider.otherwise('/firsttime');
$stateProvider
// route to show our basic form (/firsttime)
.state('firsttime', {
url: '/firsttime',
templateUrl: 'firsttime/form.html',
//controller: 'formController'
})
}])
// our controller for the form
// =============================================================================
.controller('formController', ['$scope', function($scope) {
console.log('FORM controller');
}]);
And here is form.html
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<div id="form-container">
<div class="page-header text-center">
<h2>Let's Be Friends</h2>
<!-- the links to our nested states using relative paths -->
<!-- add the active class if the state matches our ui-sref -->
<div id="status-buttons" class="text-center">
<a ui-sref-active="active" ui-sref="firsttime.profile"><span>1</span> Profile</a>
<a ui-sref-active="active" ui-sref="firsttime.interests"><span>2</span> Interests</a>
<a ui-sref-active="active" ui-sref="firsttime.payment"><span>3</span> Payment</a>
</div>
</div>
<!-- use ng-submit to catch the form submission and use our Angular function -->
<form id="signup-form" ng-submit="processForm()">
<!-- our nested state views will be injected here -->
<div id="form-views" ui-view></div>
</form>
</div>
</div>
</div>
Update Here is the nginx routing block
location / {
root html/app;
index index.html;
try_files $uri /index.html;
}