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, ], ]

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM