在cpanel上成功安装了nginx.

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

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

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

但这款CMS用这个规则还是有问题
不能进入帖子(比如):
http://www.domain.com/zixun/39-dyozh.html
apache的rewite:- RewriteRule \.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

  • RewriteRule ^zimus/([^/]*)(/?)+$ index.php?do=zimus&zimu=$1
  • RewriteRule ^quality/([^/]*)(/?)+$ index.php?do=quality&quality=$1
  • RewriteRule ^directors/([^/]*)(/?)+$ index.php?do=directors&director=$1
  • RewriteRule ^actors/([^/]*)(/?)+$ index.php?do=actors&actor=$1
  • RewriteRule ^year/([^/]*)(/?)+$ index.php?do=year&year=$1
  • # Catalog Links
  • RewriteRule ^links(/?)+$ index.php?do=links_catalog
  • RewriteRule ^links/add(/?)+$ index.php?do=links_catalog&act=add
  • RewriteRule ^links/([0-9]+)([^/]*)(/?)+$ index.php?do=links_catalog&cat=$1
  • RewriteRule ^links/([0-9]+)/([0-9]+)([^/]*)(/?)+$ index.php?do=links_catalog&cat=$1&siteid=$2
  • RewriteRule ^links/page([0-9]+)(/?)+$ index.php?do=links_catalog&cstart=$1
  • RewriteRule ^links/([0-9]+)([^/]*)/page([0-9]+)(/?)+$ index.php?do=links_catalog&cat=$1&cstart=$2
  • - RewriteRule ^donate.html$ index.php?do=donate
  • # Buy
  • RewriteRule ^buy/success.html$ index.php?do=buy&act=success
  • RewriteRule ^buy/([^/]*)/success.html$ index.php?do=buy&act=success&type=$1
  • RewriteRule ^buy/([^/])/([^/])/success.html$ index.php?do=buy&act=success&type=$1&order_id=$2
  • RewriteRule ^buy/([^/]*)/result.html$ engine/buy.php?act=result&type=$1
  • RewriteRule ^buy/([^/]*)/fail.html$ index.php?do=buy&act=fail&type=$1
  • RewriteRule ^email.html$ index.php?do=milo
  • - RewriteRule ^page/(.*)$ index.php?cstart=$1
  • RewriteRule ^forum(/?)+$ /index.php?do=forum
  • RewriteRule ^forum/category_([0-9]+)(/?)+$ index.php?do=forum&category=$1
  • RewriteRule ^forum/forum_([0-9]+)(/?)+$ index.php?do=forum&showforum=$1
  • RewriteRule ^forum/forum_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showforum=$1&cstart=$2
  • RewriteRule ^forum/topic_([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1
  • RewriteRule ^forum/topic_([0-9]+)/last(/?)+$ index.php?do=forum&showtopic=$1&lastpost=1
  • RewriteRule ^forum/topic_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1&cstart=$2
  • RewriteRule ^forum/topic_([0-9]+)/reply(/?)+$ index.php?do=forum&act=_topic&code=reply&tid=$1
  • RewriteRule ^forum/forum_([0-9]+)/add(/?)+$ index.php?do=forum&act=add_topic&forum_id=$1
  • RewriteRule ^forum/search(/?)+$ index.php?do=forum&act=search
  • RewriteRule ^forum/search/([0-9]+)-([^/]+)/([0-9]+)(/?)+$ index.php?do=forum&act=search&count_all=$1&search_text=$2&cstart=$3
  • RewriteRule ^forum/subscription(/?)+$ index.php?do=forum&act=subscription
  • RewriteRule ^forum/getnew(/?)+$ index.php?do=forum&act=getnew
  • RewriteRule ^forum/getnew/([0-9]+)(/?)+$ index.php?do=forum&act=getnew&cstart=$1
  • RewriteRule ^forum/warn/([^/]*)(/?)+$ index.php?do=forum&act=warn&user=$1
  • RewriteRule ^forum/warn/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=warn&user=$1&cstart=$2
  • RewriteRule ^forum/reputation/([^/]*)(/?)+$ index.php?do=forum&act=reputation&user=$1
  • RewriteRule ^forum/reputation/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=reputation&user=$1&cstart=$2
  • RewriteRule ^forum/textversion.html$ engine/forum/textversion.php
  • RewriteRule ^search/(.*).html?$ /index.php?do=searchcloud&subaction=search&story=$1&x=$4&y=$5
  • RewriteRule ^video(/?)+$ index.php?do=video
  • RewriteRule ^video/page-([0-9]+)(/?)+$ index.php?do=video&cstart=$1
  • RewriteRule ^video/find-([^/]+)(/?)$ index.php?do=video&find=$1
  • RewriteRule ^video/([^/]+).page-([0-9]+).html$ index.php?do=video&movie=$1&cstart=$2
  • RewriteRule ^video/([^/]+).html$ index.php?do=video&movie=$1
  • RewriteRule ^video/([^/]+)(/?)$ index.php?do=video&category=$1
  • 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=$
  • 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
  • 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
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4
  • - RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$4&news_page=$2&cstart=$3
  • RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$2
  • RewriteRule ^([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$2&newsid=$3
  • RewriteRule ^([^.]+)/([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2
  • - RewriteRule ^page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$1&cstart=$2
  • RewriteRule ^page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2&news_page=$1
  • RewriteRule ^print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$1&newsid=$2
  • RewriteRule ^([0-9]+)-(.*).html(/?)+$ index.php?newsid=$1
  • - RewriteiteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2&day=$3
  • RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&day=$3&cstart=$4
  • - RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2
  • RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&cstart=$3
  • RewriteRule ^([0-9]{4})(/?)+$ index.php?year=$1
  • RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ index.php?year=$1&cstart=$2
  • - RewriteRule ^tags/([^/]*)(/?)+$ index.php?do=tags&tag=$1
  • RewriteRule ^tags/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=tags&tag=$1&cstart=$2
  • RewriteRule ^user/([^/]*)/rss.xml$ engine/rss.php?subaction=allnews&user=$1
  • RewriteRule ^user/([^/]*)(/?)+$ index.php?subaction=userinfo&user=$1
  • RewriteRule ^user/([^/]*)/page/([0-9]+)(/?)+$ index.php?subaction=userinfo&user=$1&cstart=$2
  • RewriteRule ^user/([^/]*)/news(/?)+$ index.php?subaction=allnews&user=$1
  • RewriteRule ^user/([^/]*)/news/page/([0-9]+)(/?)+$ index.php?subaction=allnews&user=$1&cstart=$2
  • RewriteRule ^user/([^/]*)/news/rss.xml(/?)+$ engine/rss.php?subaction=allnews&user=$1
  • RewriteRule ^lastnews/(/?)+$ index.php?do=lastnews
  • RewriteRule ^lastnews/page/([0-9]+)(/?)+$ index.php?do=lastnews&cstart=$1
  • RewriteRule ^catalog/([^/]*)(/?)+$ index.php?catalog=$1
  • RewriteRule ^catalog/([^/]*)/page/([0-9]+)(/?)+$ index.php?catalog=$1&cstart=$2
  • RewriteRule ^newposts(/?)+$ index.php?subaction=newposts
  • RewriteRule ^newposts/page/([0-9]+)(/?)+$ index.php?subaction=newposts&cstart=$1
  • RiteRule ^static/(.*).html(/?)+$ index.php?do=static&page=$1
  • #DownPage
  • RewriteRule ^getfile-([0-9]+)+$ /engine/downpage.php?get=$1
  • RewriteRule ^getstfile-([0-9]+)+$ /engine/downpage.php?get=$1&area=static
  • RewriteRule ^favorites(/?)+$ index.php?do=favorites
  • RewriteRule ^mchat(/?)+$ index.php?do=mchat
  • RewriteRule ^mchat/history(/?)+$ index.php?do=mchat_history
  • RewriteRule ^mchat/history/page(.*).html(/?)+$ index.php?do=mchat_history&cstart=$1
  • RewriteRule ^favorites/page/([0-9]+)(/?)+$ index.php?do=favorites&cstart=$1
  • - RewriteRule ^rules.html$ index.php?do=rules
  • RewriteRule ^statistics.html$ index.php?do=stats
  • RewriteRule ^addnews.html$ index.php?do=addnews
  • RewriteRule ^rss.xml$ engine/rss.php
  • RewriteRule ^sitemap.xml$ uploads/sitemap.xml
  • - RewriteCond %{REQUEST_FILENAME} !-d
  • RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$ index.php?do=cat&category=$1&cstart=$2
  • RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1
  • - RewriteCond %{REQUEST_FILENAME} !-f
  • RewriteRule ^([^复制代码不知道是.htaccess的问题还是什么

我想禁用apache的.htaccess,改用nginx的- 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
  • }
  • }复制代码改怎么做?