Angular.js页面刷新/刷新给出错误500内部服务器错误

时间:2018-09-10 05:20:16

标签: angularjs

当我刷新页面时,我为我的项目使用angularjs 1.6,它给我一个错误 500 Internal Server Error (<内部服务器错误) nginx 我使用的

<base href="/" /> 

在index.html文件中,我还包含config.js文件

'use strict';

abc.config(['$ocLazyLoadProvider', 'localStorageServiceProvider', '$stateProvider', '$urlRouterProvider', '$locationProvider',
function ($ocLazyLoadProvider, localStorageServiceProvider, $stateProvider, $urlRouterProvider, $locationProvider) {
    localStorageServiceProvider.setPrefix('chasebid');

    $ocLazyLoadProvider.config({
        debug: false,
        events: true,
    });

    $urlRouterProvider.otherwise('/home');
    $locationProvider.html5Mode(true);

    // $locationProvider.html5Mode({
        // enabled: true,
        // requireBase: false
    // });


    $stateProvider
    .state('home', {
        url: '/home',
        templateUrl: 'angular_view/Index/indexbody.html',
        controller: 'indexBodyController',
        resolve: {
            loadMyFile: function ($ocLazyLoad) {
                return $ocLazyLoad.load({
                    name: 'abc',
                    files: ['angular_project_file/controllers/indexBodyController.min.js']

                })
            }
        } // END state
    }).state('aboutus', {
        url: '/about_us',
        templateUrl: 'angular_view/aboutus/aboutus.html',

    }).state('details', {
        url: '/details:detailsId',
        templateUrl: 'angular_view/details/details.html',
        controller: 'auctionDetailsController',
        resolve: {
            loadMyFile: function ($ocLazyLoad) {
                return $ocLazyLoad.load({
                    name: 'abc',
                    files: ['angular_project_file/controllers/DetailsController.min.js']

                })
            }
        } // END  state
    }).state('buy', {
        url: '/buy',
        templateUrl: 'angular_view/buy/buy.html',
        controller: 'buyController',
        resolve: {
            loadMyFile: function ($ocLazyLoad) {
                return $ocLazyLoad.load({
                    name: 'abc',
                    files: ['angular_project_file/controllers/buyController.min.js']
                })
            }
        } // END state
    }).state('contactus', {
        url: '/contact_us',
        templateUrl: 'angular_view/contactus/contactus.html',

    }).state('faq', {
        url: '/FAQ',
        templateUrl: 'angular_view/faq/faq.html',

    }).state('freeauctions', {
        url: '/free_auctions',
        templateUrl: 'angular_view/free_auctions/free.html',
        controller: 'freeController',
        resolve: {
            loadMyFile: function ($ocLazyLoad) {
                return $ocLazyLoad.load({
                    name: 'abc',

                    files: ['angular_project_file/controllers/freeController.min.js']
                })
            }
        } // END state
    ;





}])

当我刷新页面时,状态不加载是什么问题,因为在localhost中它可以正常工作,但是在生产服务器中,它给我类似的错误 500内部服务器错误nginx

0 个答案:

没有答案