子文件夹中的Codeigniter不适用于AngularJS应用程序

时间:2016-01-04 13:39:12

标签: javascript php angularjs codeigniter nginx

我正在尝试从github设置此https://secure.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class。 我所做的所有更改都是,更改数据库配置,以便Codeigniter应用程序连接到数据库。我的网页打开完美,但看起来它在访问Codeigniter资源时遇到了一些问题。 Clock application

可能是Nginx服务器指令中的问题,所以这是我的Nginx代码

127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /css/bootstrap.min.css HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /css/bootstrap-theme.min.css HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /css/style.css HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /app/angular/angular.min.js HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /app/angular/angular-route.js HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /app/app.js HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /app/controllers/clockCtrl.js HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /app/controllers/addCtrl.js HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /app/controllers/projectCtrl.js HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:12 +0100] "GET /app/services/dbSrvc.js HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:13 +0100] "GET /server/index.php/projects/load HTTP/1.1" 404 200 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"
127.0.0.1 - - [04/Jan/2016:14:31:13 +0100] "GET /app/views/welcome.html HTTP/1.1" 304 0 "http://clocks.si/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36"

这是我的Nginx访问日志,我们可以看到它从Codeigniter加载资源(404)时出现问题

let currentInstallation = PFInstallation.currentInstallation()
               currentInstallation.deleteInBackground() 

更新
我也尝试使用WAMP在Windows机器上设置这个应用程序,除了配置数据库信息之外它没有任何其他需要的配置,所以我假设它必须是nginx方面的东西
...

我希望你们能帮助我。如果您需要任何其他信息,请告诉我,我会提供。提前谢谢

1 个答案:

答案 0 :(得分:0)

重新配置nginx服务器指令为我完成了这项工作。

server {
        listen 80;
        listen [::]:80;

        root /var/www/html/clocks.si/public_html;

        index index.html index.htm index.php;

        server_name clocks.si;

        location / {
                try_files $uri $uri/ /index.html =404;
        }

        location /server/ {
                index /server/index.php;
                try_files $uri /server/index.php/$uri;
        }

        location ~ [^/]\.php(/|$) {
                fastcgi_split_path_info ^(.+?\.php)(/.*)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                include fastcgi.conf;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
        }


        #deny access to .htaccess files, if Apache's document root
        #concurs with nginx's one

        location ~ /\.ht {
               deny all;
        }

}