参考:https://wenku.baidu.com/view/b71776e2680203d8cf2f2459.html
yii2 config web.php中的url规则:
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ '/' => 'site/index', '<controller:\w+/?>' => '<controller>', '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', ], ],
nginx服务器规则修改:
cd /usr/local/nginx/conf/nginx.conf:
整体参考如下:
user www www;
worker_processes auto;
error_log /home/wwwlogs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can