本帖最后由 追影 于 2016-3-3 11:58 编辑
在服务器中切换到nginx的安装目录,我这里是 /usr/local/nginx。然后添加 dami.conf 文件 vim /usr/local/nginx/conf/dami.conf 内容如下
- location / {
- if (!-e $request_filename){
- rewrite ^/(.*)$ /index.php?s=/$1 last;
- }
- }
- location /Admin/Tpl/ {
- deny all;
- }
- location /Web/Tpl/ {
- deny all;
- }
复制代码
然后在你的配置文件中include一下刚刚的配置文件。
注意:如果你的入口文件index.php不在根目录,则需要把dami.conf改成这样
- location /入口文件所在目录/ {
- if (!-e $request_filename){
- rewrite ^/入口文件所在目录/(.*)$ /入口文件所在目录/index.php?s=/$1 last;
- }
- }
复制代码
|