1.打开虚拟机的配置文件:
/usr/local/nginx/conf/vhost/www.xiechui.com.conf(此文件根据你的域名不同,请自行修改)
修改文件中的:include discuzx.conf;为include weibo.conf;
2.新建一个weibo.conf,加入以下代码,保存,
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
上传到:/usr/local/nginx/conf/目录下
3. 重新加载nginx配置文件
# /etc/init.d/nginx reload
修改追加伪静态参考:LNMP下给已存在的虚拟机追加或修改伪静态规则
鞋锤博客