lnmp+yii2来部署我的项目,我想讲参数路径化,也就是localhost/login/login/id/2/xxx/xxx.html
但是失败了,不知道原因在哪里,这是我的nginx配置,和yii2的main文件配置,
location / {
# root html;
index index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
}
location ~ .*\.php {
# root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
main.php配置:
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'enableStrictParsing' => false, //不启用严格解析
'showScriptName' => false,
'suffix' => '.html',
'rules' => [
],
],
弄了一下午了,还是不知道原因,跪求各位大神帮忙
目前暂无任何回答
- 0 回答
- 0 关注
- 1426 浏览
添加回答
举报
0/150
提交
取消