VPS侦探论坛

 找回密码
 注册
查看: 9252|回复: 8

burst vps安装了lnmp情况下实现discuzX2.0伪静态最简便方法

[复制链接]
发表于 2011-8-24 15:09:33 | 显示全部楼层 |阅读模式

方法是:拿discuzX2管理后台的规则随便建个如discuzx.conf放在/usr/local/nginx/conf/,然后在在usr/local/nginx/conf找到nginx.conf,在里面的server部分的root  /home/wwwroot;下面加 include discuzx.conf;。然后删除你的虚拟主机重建。就可以了。

[ 本帖最后由 xcabove 于 2011-8-24 17:32 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-8-24 15:15:51 | 显示全部楼层


伪静态必须用dx2的nginx伪静态,贴上配置和伪静态内容看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-8-24 15:23:39 | 显示全部楼层

Nginx Web Server

配置规则如下:

rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%
3D$4&page=$3 last;
rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last;
if (!-e $request_filename) {
return 404;
}


放在设置虚拟主机的时候,新增的other.conf规则里面,怎么不见有效呢。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-8-24 15:31:29 | 显示全部楼层



重启nginx了没?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-8-24 15:45:20 | 显示全部楼层

重启了/root/lnmp restart  nginx -s reload 等命令都试了。就是不知道用子目录建论坛,是不是必须要在vps上建虚拟主机。如果建虚拟主机,并绑定一个新域名,要在哪里把规则加进去。

军哥运维代购:http://shop63846532.taobao.com/

发表于 2011-8-24 16:58:52 | 显示全部楼层

上面的伪静态只适合用的虚拟主机根目录,二级目录不能使用。
 楼主| 发表于 2011-8-24 17:05:23 | 显示全部楼层

二级目录实现伪静态要怎么办呢?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-8-24 17:12:44 | 显示全部楼层

已经搞定了,拿上面的规则随便填个如discuzx.conf,然后在在root/usr/local/nginx/conf找到nginx.conf,在里面的root  /home/wwwroot;下面加 include discuzx.conf。然后删除你的虚拟主机重建。就可以了。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-3-4 22:38:22 | 显示全部楼层

原帖由 xcabove 于 2011-8-24 17:12 发表
已经搞定了,拿上面的规则随便填个如discuzx.conf,然后在在root/usr/local/nginx/conf找到nginx.conf,在里面的root  /home/wwwroot;下面加 include discuzx.conf。然后删除你的虚拟主机重建。就可以了。 ...



一定要重建?这部麻烦吗?有没有什么办法不用重建?

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-22 11:30 , Processed in 0.028167 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表