容器技术交流

 找回密码
 立即注册
查看: 2170|回复: 3

新建站点使用Ngnix规则的问题

[复制链接]
发表于 2011-12-16 20:14:08 | 显示全部楼层 |阅读模式
刚开始使用LUM,在论坛找了很久,一直对Ngnix的使用方法不太明白

以前的用的vps是装的LNMP,所以可以指定Ngnix的路径给网站程序

用了LUM后,在后台新建站点的时候,取消使用Apache的2个选项,应该就是默认使用Ngnix了吧,然后怎么设置使用程序自带的Ngnix的呢?  一般都是xxxx.conf文件形式的。

发表于 2011-12-16 20:20:46 | 显示全部楼层
程序自带的nginx?
LUM是不用设置的,如果要自己设置,可以在系统管理里修改vhost.conf
 楼主| 发表于 2011-12-16 20:35:30 | 显示全部楼层
比如ecshop和skyuc的Ngnix的伪静态规则就不一样  也不能统一用一个Ngnix的伪静态规则文件吧
 楼主| 发表于 2011-12-16 20:54:33 | 显示全部楼层
我以前可以正常使用的一个Ngnix的伪静态全部内容如下:

location /
{
rewrite ^/index.html$    /index.php last;
rewrite ^/list.html$     /index.php last;
rewrite ^/show.html$     /index.php last;
rewrite ^/rss.xml$       /rss.php last;
rewrite ^/list-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)-([a-zA-Z]+)(.*)\.html$     /list.php?id=$1&page=$2&sort=$3&order=$4&display=$5  last;
rewrite ^/list-([0-9]+)(.*)\.html$                                   /list.php?id=$1  last;
rewrite ^/show-([0-9]+)(.*)\.html$                                   /show.php?id=$1  last;
rewrite ^/show-([0-9]+)(.*)\.html\?id=([0-9]*)&srv=([0-9]+)$         /show.php?id=$1&srv=$2  last;
rewrite ^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$  /article_cat.php?id=$1&page=$2&sort=$3&order=$4  last;
rewrite ^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$                   /article_cat.php?id=$1&page=$2   last;
rewrite ^/article_cat-([0-9]+)(.*)\.html$                            /article_cat.php?id=$1     last;
rewrite ^/article-([0-9]+)(.*)\.html$                                /article.php?id=$1    last;
rewrite ^/subject-([0-9]+)(.*)\.html$                                     /subject.php?id=$1        last;
break;
}
location ~ .*\.(dwt|lbi)?$ {
rewrite \.(dwt|lbi)$ /error.png;
}


如果要让lum用的话,是放到新建站点里面的【Nginx扩展设置 (location段)】后面的框里么?
是全部复制 还是要去掉一部分放进去才生效?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2025-5-15 22:31 , Processed in 0.027647 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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