Не работают красивые урлы в бэкенде.
Вот конфиг nginx:
Код: Выделить всё
server {
set $project_root /var/www/fantasy-datacenter;
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name fantasy-datacenter.lh;
root $project_root/frontend/web/;
index index.php;
access_log /var/www/fantasy-datacenter/access.log;
error_log /var/www/fantasy-datacenter/error.log;
location ^~ /backend {
rewrite ^/backend(.*)$ /backend/web$1 last;
}
location ^~ /backend/web {
root $project_root;
# uncomment the following, if you want to enable speaking URL in the backend
#try_files $uri $uri/ /index.php$is_args$args;
location ~ /\.(ht|svn|git) {
deny all;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_pass php-fantasy-datacenter:9000;
fastcgi_read_timeout 300;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
}
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php?$args;
}
# uncomment to avoid processing of calls to non-existing static files by Yii
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
# try_files $uri =404;
#}
#error_page 404 /404.html;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_pass php-fantasy-datacenter:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
location ~ /\.(ht|svn|git) {
deny all;
}
}
Код: Выделить всё
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
'modules' => [
],
'components' => [
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'assetManager' => [
'class' => 'yii\web\AssetManager',
'bundles' => [
'insolita\wgadminlte\ExtAdminlteAsset' => [
'depends' => [
'yii\web\YiiAsset',
'dmstr\web\AdminLteAsset'
]
],
'insolita\wgadminlte\JCookieAsset' => [
'sourcePath' => '@bower/jquery-cookie',
'depends' => [
'yii\web\YiiAsset',
'dmstr\web\AdminLteAsset'
],
],
'dmstr\web\AdminLteAsset' => [
'skin' => 'skin-black',
],
]
],
'request' => [
'baseUrl' => '/backend',
'csrfParam' => '_backend_csrf',
],
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
'frontUrlManager' => require(__DIR__ . '/../../frontend/config/url_manager.php'),
],
'params' => $params,
];
читал вот это - http://rmcreative.ru/blog/post/nginx--p ... asivye-url
менял настройку, ничего не помогает.
Что делать? У нас уже пол команды убило на это кучу времени. На апаче всё работало.