yii2部署nginx

頁面所有提示404,
nginx平臺下須要額外配置yii rewrite規則,配置以下: 在nginx 的配置文件nginx.conf //增長部分 location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php?$args; } 重啓nginx服務 //路由優化 'components' => [ 'urlManager' => [ 'class' => 'yii\web\UrlManager', 'enablePrettyUrl' => true, 'showScriptName' => false, ], ]
相關文章
相關標籤/搜索