Answer the question
In order to leave comments, you need to log in
How to make CNC work in Nginx via php-fpm?
Good afternoon. There is a project - https://github.com/vladimir-s/personal-maps. Written in Yii, the author transforms internal links according to the following rule:
'urlManager'=>array( 'urlFormat'=>'path',
'rules'=>array(
// REST patterns
array('places/list', 'pattern'=>'api/places', 'verb'=>'GET'),
...
// regular patterns
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
'showScriptName'=>false,
),
server {
listen 80;
root /var/www/tyvik/personal_maps/public_html;
index index.html index.php;
server_name personal_maps.tyvik.ru;
location / {
try_files $uri $uri/ /index.php?r=$request_uri;
}
error_page 404 /404.html;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.www.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
access_log off;
}
}
Answer the question
In order to leave comments, you need to log in
what about yii? the job of apache or in your case nginx is to redirect ALL requests to index.php. Next, yii will parse the original url. So the problem is with the config or with passing parameters to fpm.
the problem in theory is this line:
try_files $uri $uri/ /index.php?r=$request_uri;
the request must be redirected to /index.php/$request_uri
There are a million examples of setting all this under nginx. even in the documentation
www.yiiframework.com/doc/guide/1.1/en/quickstart.a...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question