VPS侦探论坛

 找回密码
 注册
查看: 5690|回复: 2

求助:在网站子目录中加一个blog,LNMP的配制文件不起作用

[复制链接]
发表于 2012-7-28 22:46:51 | 显示全部楼层 |阅读模式

服务器架构LNMP,独立VPS,近来想在子目录中装个WP,可一访问总是出现505找不到错误,求大侠指点啊,在网上查了半天,应该也没有什么错误。。配制文件如下:server

{

listen       80;

server_name lacewigsfront.com www.lacewigsfront.com;

index index.html index.htm index.php default.html default.htm default.php;

root  /home/wwwroot/sites;


if ($host != 'www.lacewigsfront.com') {
            rewrite ^/(.*)$ http://www.lacewigsfront.com/ $1 permanent ;
        }



include prestarshop.conf;


error_page 404 = http://www.lacewigsfront.com/ ;


location /blog/ {

root   /home/wwwroot/sites/blog;

    index  index.php index.html;


    if ($request_uri ~* ^.*/.*$) {

     rewrite ^/(\w*)/(.*)$ /$1/index.php?q=$2 last;

     break;

    }

}



VPS新手,如问题过于简单,请谅解。。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2012-7-29 11:05:17 | 显示全部楼层


没必要叫location /blog/,如果是wp,要用伪静态用wp2.conf 就行了,把wp2.conf里的目录改成你的就行
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-7-29 13:44:42 | 显示全部楼层

感谢军哥啊,我试试。。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-23 13:26 , Processed in 0.026152 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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