1
방금 개발에서 프로덕션으로 이전했습니다. 프로덕션 환경에서 라우팅이 작동하지 않는다는 것을 깨달았습니다. LEMP 스택을 사용하고 있습니다.Phalcon 라우팅이 Nginx에서 작동하지 않습니다.
나를 올바른 방향으로 인도 할 수있는 사람이 있습니까?
이것은 내 nginx 구성입니다.
server {
listen 80;
server_name localhost;
charset utf-8;
index index.php index.html index.htm;
set $root_path '/usr/share/nginx/ppl/public';
root $root_path;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index /index.php;
#fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.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;
}
location ~ /\.ht {
deny all;
}
}
여기 내 라우팅 코드 스 니펫입니다.
$di->set('router', function() { $router = new Router();
$router->add(
'/list/([0-9]+)/([a-z0-9\-]+)',
array(
'controller' => 'Listing',
'action' => 'detailed',
'id' => 1,
'title' => 2
)
);
$router->add('/', array(
'controller' => 'Listing',
'action' => 'home'
));
$router->removeExtraSlashes(true);
return $router;
},true);
URL을 통해 컨트롤러 및 해당 작업에 액세스 할 수 있습니다.
중요한 것이 있습니까?
감사합니다.