Nginx config
server {
listen 80;
index index.php index.html index.htm;
set $root_path /var/www/html/store/public;
root $root_path;
server_name 139.59.26.52;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^((?U).+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
#fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
}
Loader (app/config/loader.php)
<?php
$loader = new \Phalcon\Loader();
$loader->registerDirs(
[
$config->application->controllersDir,
$config->application->modelsDir
]
)->register();
IndexController.php
<?php
class IndexController extends ControllerBase
{
public function indexAction()
{
$this->view->disable();
echo ($_SERVER['REQUEST_URI']);
}
}
TestController.php
<?php
class TestController extends ControllerBase
{
public function indexAction()
{
$this->view->disable();
echo 'Test';
}
}
139.59.26.52/index/index
then it should display
/index/index
139.59.26.52/test/index
then it should display
Test
but i get
/test/index