找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 77|回复: 7

在cpanel上成功装了nginx,各位大侠帮忙!

[复制链接]

10

主题

40

回帖

118

积分

注册会员

积分
118
发表于 2010-5-19 22:37:54 | 显示全部楼层 |阅读模式
在cpanel上成功安装了nginx.

非常不错,速度极快。而且phpwind,whmcs都没问题,好像

但是让我头疼的是由于我的主站是用了俄罗斯的一款CMS系统。

现在的情况是,在cpanel上的nginx可以兼容.htaccess
也就是说主站在用apache的rewrite规则

但这款CMS用这个规则还是有问题
不能进入帖子(比如):
http://www.domain.com/zixun/39-dyozh.html
apache的rewite:[ol]
  • RewriteRule \.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
  • RewriteRule ^zimus/([^/]*)(/?)+$ index.php?do=zimus&zimu=$1 [L]
  • RewriteRule ^quality/([^/]*)(/?)+$ index.php?do=quality&quality=$1 [L]
  • RewriteRule ^directors/([^/]*)(/?)+$ index.php?do=directors&director=$1 [L]
  • RewriteRule ^actors/([^/]*)(/?)+$ index.php?do=actors&actor=$1 [L]
  • RewriteRule ^year/([^/]*)(/?)+$ index.php?do=year&year=$1 [L]
  • # Catalog Links
  • RewriteRule ^links(/?)+$ index.php?do=links_catalog [L]
  • RewriteRule ^links/add(/?)+$ index.php?do=links_catalog&act=add [L]
  • RewriteRule ^links/([0-9]+)([^/]*)(/?)+$ index.php?do=links_catalog&cat=$1 [L]
  • RewriteRule ^links/([0-9]+)/([0-9]+)([^/]*)(/?)+$ index.php?do=links_catalog&cat=$1&siteid=$2 [L]
  • RewriteRule ^links/page([0-9]+)(/?)+$ index.php?do=links_catalog&cstart=$1 [L]
  • RewriteRule ^links/([0-9]+)([^/]*)/page([0-9]+)(/?)+$ index.php?do=links_catalog&cat=$1&cstart=$2 [L]
  • RewriteRule ^donate.html$ index.php?do=donate[L]
  • # Buy
  • RewriteRule ^buy/success.html$ index.php?do=buy&act=success [L]
  • RewriteRule ^buy/([^/]*)/success.html$ index.php?do=buy&act=success&type=$1 [L]
  • RewriteRule ^buy/([^/]*)/([^/]*)/success.html$ index.php?do=buy&act=success&type=$1&order_id=$2 [L]
  • RewriteRule ^buy/([^/]*)/result.html$ engine/buy.php?act=result&type=$1 [L]
  • RewriteRule ^buy/([^/]*)/fail.html$ index.php?do=buy&act=fail&type=$1 [L]
  • RewriteRule ^email.html$ index.php?do=milo [L]
  • RewriteRule ^page/(.*)$ index.php?cstart=$1 [L]
  • RewriteRule ^forum(/?)+$ /index.php?do=forum [L]
  • RewriteRule ^forum/category_([0-9]+)(/?)+$ index.php?do=forum&category=$1 [L]
  • RewriteRule ^forum/forum_([0-9]+)(/?)+$ index.php?do=forum&showforum=$1 [L]
  • RewriteRule ^forum/forum_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showforum=$1&cstart=$2 [L]
  • RewriteRule ^forum/topic_([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1 [L]
  • RewriteRule ^forum/topic_([0-9]+)/last(/?)+$ index.php?do=forum&showtopic=$1&lastpost=1 [L]
  • RewriteRule ^forum/topic_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1&cstart=$2 [L]
  • RewriteRule ^forum/topic_([0-9]+)/reply(/?)+$ index.php?do=forum&act=_topic&code=reply&tid=$1 [L]
  • RewriteRule ^forum/forum_([0-9]+)/add(/?)+$ index.php?do=forum&act=add_topic&forum_id=$1 [L]
  • RewriteRule ^forum/search(/?)+$ index.php?do=forum&act=search [L]
  • RewriteRule ^forum/search/([0-9]+)-([^/]+)/([0-9]+)(/?)+$ index.php?do=forum&act=search&count_all=$1&search_text=$2&cstart=$3 [L]
  • RewriteRule ^forum/subscription(/?)+$ index.php?do=forum&act=subscription [L]
  • RewriteRule ^forum/getnew(/?)+$ index.php?do=forum&act=getnew [L]
  • RewriteRule ^forum/getnew/([0-9]+)(/?)+$ index.php?do=forum&act=getnew&cstart=$1 [L]
  • RewriteRule ^forum/warn/([^/]*)(/?)+$ index.php?do=forum&act=warn&user=$1 [L]
  • RewriteRule ^forum/warn/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=warn&user=$1&cstart=$2 [L]
  • RewriteRule ^forum/reputation/([^/]*)(/?)+$ index.php?do=forum&act=reputation&user=$1 [L]
  • RewriteRule ^forum/reputation/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=reputation&user=$1&cstart=$2 [L]
  • RewriteRule ^forum/textversion.html$ engine/forum/textversion.php [L]
  • RewriteRule ^search/(.*).html?$ /index.php?do=searchcloud&subaction=search&story=$1&x=$4&y=$5 [L]
  • RewriteRule ^video(/?)+$ index.php?do=video [L]
  • RewriteRule ^video/page-([0-9]+)(/?)+$ index.php?do=video&cstart=$1 [L]
  • RewriteRule ^video/find-([^/]+)(/?)$ index.php?do=video&find=$1 [L]
  • RewriteRule ^video/([^/]+).page-([0-9]+).html$ index.php?do=video&movie=$1&cstart=$2 [L]
  • RewriteRule ^video/([^/]+).html$ index.php?do=video&movie=$1 [L]
  • RewriteRule ^video/([^/]+)(/?)$ index.php?do=video&category=$1 [L]
  • RwriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$[L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$ engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4 [L]
  • RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$4&news_page=$2&cstart=$3 [L]
  • RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$2 [L]
  • RewriteRule ^([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$2&newsid=$3 [L]
  • RewriteRule ^([^.]+)/([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2 [L]
  • RewriteRule ^page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$1&cstart=$2 [L]
  • RewriteRule ^page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2&news_page=$1 [L]
  • RewriteRule ^print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$1&newsid=$2 [L]
  • RewriteRule ^([0-9]+)-(.*).html(/?)+$ index.php?newsid=$1 [L]
  • RewriteiteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2&day=$3 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&day=$3&cstart=$4 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2 [L]
  • RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&cstart=$3 [L]
  • RewriteRule ^([0-9]{4})(/?)+$ index.php?year=$1 [L]
  • RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ index.php?year=$1&cstart=$2 [L]
  • RewriteRule ^tags/([^/]*)(/?)+$ index.php?do=tags&tag=$1 [L]
  • RewriteRule ^tags/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=tags&tag=$1&cstart=$2 [L]
  • RewriteRule ^user/([^/]*)/rss.xml$ engine/rss.php?subaction=allnews&user=$1 [L]
  • RewriteRule ^user/([^/]*)(/?)+$ index.php?subaction=userinfo&user=$1 [L]
  • RewriteRule ^user/([^/]*)/page/([0-9]+)(/?)+$ index.php?subaction=userinfo&user=$1&cstart=$2 [L]
  • RewriteRule ^user/([^/]*)/news(/?)+$ index.php?subaction=allnews&user=$1 [L]
  • RewriteRule ^user/([^/]*)/news/page/([0-9]+)(/?)+$ index.php?subaction=allnews&user=$1&cstart=$2 [L]
  • RewriteRule ^user/([^/]*)/news/rss.xml(/?)+$ engine/rss.php?subaction=allnews&user=$1 [L]
  • RewriteRule ^lastnews/(/?)+$ index.php?do=lastnews [L]
  • RewriteRule ^lastnews/page/([0-9]+)(/?)+$ index.php?do=lastnews&cstart=$1 [L]
  • RewriteRule ^catalog/([^/]*)(/?)+$ index.php?catalog=$1 [L]
  • RewriteRule ^catalog/([^/]*)/page/([0-9]+)(/?)+$ index.php?catalog=$1&cstart=$2 [L]
  • RewriteRule ^newposts(/?)+$ index.php?subaction=newposts [L]
  • RewriteRule ^newposts/page/([0-9]+)(/?)+$ index.php?subaction=newposts&cstart=$1 [L]
  • RiteRule ^static/(.*).html(/?)+$ index.php?do=static&page=$1 [L]
  • #DownPage
  • RewriteRule ^getfile-([0-9]+)+$ /engine/downpage.php?get=$1 [L]
  • RewriteRule ^getstfile-([0-9]+)+$ /engine/downpage.php?get=$1&area=static [L]
  • RewriteRule ^favorites(/?)+$ index.php?do=favorites [L]
  • RewriteRule ^mchat(/?)+$ index.php?do=mchat [L]
  • RewriteRule ^mchat/history(/?)+$ index.php?do=mchat_history [L]
  • RewriteRule ^mchat/history/page(.*).html(/?)+$ index.php?do=mchat_history&cstart=$1 [L]
  • RewriteRule ^favorites/page/([0-9]+)(/?)+$ index.php?do=favorites&cstart=$1 [L]
  • RewriteRule ^rules.html$ index.php?do=rules [L]
  • RewriteRule ^statistics.html$ index.php?do=stats [L]
  • RewriteRule ^addnews.html$ index.php?do=addnews [L]
  • RewriteRule ^rss.xml$ engine/rss.php [L]
  • RewriteRule ^sitemap.xml$ uploads/sitemap.xml [L]
  • RewriteCond %{REQUEST_FILENAME} !-d
  • RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$ index.php?do=cat&category=$1&cstart=$2 [L]
  • RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1 [L]
  • RewriteCond %{REQUEST_FILENAME} !-f
  • RewriteRule ^([^复制代码不知道是.htaccess的问题还是什么

    我想禁用apache的.htaccess,改用nginx的[ol]
  • server {
  •         listen       8081;
  •         server_name  mysite.com;
  • #        charset utf-8;
  • set_real_ip_from   192.168.1.1;
  • real_ip_header     X-Real-IP;
  •         access_log  /var/log/nginx/access.log  main;
  •         error_log  /var/log/nginx/error.log  error;
  •         location / {
  •             root   /var/www;
  •             index  index.html index.php;
  •         }
  •         location ~ /.ht {
  •             denyall;
  •         }
  •         location ~ .php$ {
  •         rewrite ^/page/(.*)$ /index.php?cstart=$1 last;
  •         我的 rewrite............................................
  •             if (!-f $request_filename) {^M
  •              rewrite ^/([^/]+).html$ /index.php?do=static&page=$1 last;^M
  • }         
  •         }[/ol]复制代码改怎么做?
  • 回复

    使用道具 举报

    10

    主题

    40

    回帖

    118

    积分

    注册会员

    积分
    118
     楼主| 发表于 2010-5-19 22:41:20 | 显示全部楼层
    我的意思是怎么禁用apache的,换用nginx的
    rewrite我自己会改
    回复

    使用道具 举报

    261

    主题

    1097

    回帖

    3021

    积分

    论坛元老

    积分
    3021
    发表于 2010-5-19 22:43:58 | 显示全部楼层
    俄罗斯的CMS 楼主厉害呀 喜欢用毛子的东西
    回复

    使用道具 举报

    208

    主题

    1519

    回帖

    3716

    积分

    论坛元老

    积分
    3716
    发表于 2010-5-19 22:47:53 | 显示全部楼层
    可能没说清楚,我的vhost的是这样的:[ol]
  • server {
  •           error_log /var/log/nginx/vhost-error_log warn;
  •           listen 80;
  •           server_name domain.com www.domain.com IP;
  •           access_log /usr/local/apache/domlogs/domain.com-bytes_log bytes_log;
  •           access_log /usr/local/apache/domlogs/domain.com combined;
  •           location ~* \.(gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|htm|html|txt|js|css|exe|zip|rar|gz|tgz|uha|7z|doc|docx|xls|xlsx|pdf)$ {
  •           root /home/kiddo90/public_html;
  •           }
  • location ~ .php$ {
  •         rewrite ^/page/(.*)$ /index.php?cstart=$1 last;
  • 我的rewrite
  • rewrite ^/([^/]+).html$ /index.php?do=static&page=$1 last;
  • }[/ol]复制代码不是已经有了吗? 可怎么禁用apache呢?他还是安装apache的来
    apache在80端口,nginx在8081

    [ 本帖最后由 90rs 于 2010-5-19 22:54 编辑 ]
  • 回复

    使用道具 举报

    10

    主题

    40

    回帖

    118

    积分

    注册会员

    积分
    118
     楼主| 发表于 2010-5-19 22:53:00 | 显示全部楼层
    禁用APACHE  的REWRITE么 如果REWRITE在 htaccess里面配置的 把 htaccess
    里面的删掉不就行了?
    看不懂你的意思  你弄了 APACHE  和NGINX  你到底用NGINX的 8081 端口干什么呀,网站难道用8081端口访问么
    别人都把APACHE端口弄成其他的 然后用NGINX 转反向代理呢
    回复

    使用道具 举报

    208

    主题

    1519

    回帖

    3716

    积分

    论坛元老

    积分
    3716
    发表于 2010-5-19 23:21:35 | 显示全部楼层
    饿,说反了。臰了。但到底改怎么做呢
    回复

    使用道具 举报

    261

    主题

    1097

    回帖

    3021

    积分

    论坛元老

    积分
    3021
    发表于 2010-5-20 00:00:38 | 显示全部楼层
    赞同解决了,把html|htm删除就可以了
    nginx多管闲事造成.html出现404error错误。
    回复

    使用道具 举报

    10

    主题

    40

    回帖

    118

    积分

    注册会员

    积分
    118
     楼主| 发表于 2010-5-20 00:23:51 | 显示全部楼层
    即装apache,又装nginx?
    回复

    使用道具 举报

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

    本版积分规则

    Archiver|手机版|小黑屋|Discuz! X

    GMT+8, 2025-1-12 06:16 , Processed in 0.023787 second(s), 5 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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