yii2 nginx去掉index.php?r=

时间:2021-01-16 19:58:51
nginx目录下的nginx.config的location节点添加如下配置 
location / {
  if (!-e $request_filename) {
      rewrite  ^(.*)$  /index.php?s=/$1  last;
  }
}