<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>曾华水的博客 &#187; Nginx</title>
	<atom:link href="http://www.mrzeng.com/tag/nginx/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mrzeng.com</link>
	<description>NO.1 or Nothing</description>
	<lastBuildDate>Wed, 07 Sep 2011 12:47:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>常用的PHP系统在nginx下的伪静态规则</title>
		<link>http://www.mrzeng.com/post/nginx-rewrite-in-common-systems.html</link>
		<comments>http://www.mrzeng.com/post/nginx-rewrite-in-common-systems.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 08:17:15 +0000</pubDate>
		<dc:creator>zenghuashui</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.mrzeng.com/?p=149</guid>
		<description><![CDATA[常用的系统在nginx下的伪静态规则。 CMS系统 PHPCMS： location / { ###以下为PHPCMS 伪静态化rewrite规则 rewrite ^(.*)show-([0-9]+)-([0-9]+).html$ $1/show.php?itemid=$2&#038;page=$3; rewrite ^(.*)list-([0-9]+)-([0-9]+).html$ $1/list.php?catid=$2&#038;page=$3; rewrite ^(.*)show-([0-9]+).html$ $1/show.php?specialid=$2; } 商城shopex location / { if (!-e $request_filename) { rewrite ^/(.+.(html&#124;xml&#124;json&#124;htm&#124;php&#124;jsp&#124;asp&#124;shtml))$ /index.php?$1 last; } } ECSHOP if (!-e $request_filename) { rewrite “^/index.html” /index.php last; rewrite “^/category$” /index.php last; rewrite “^/feed-c([0-9]+).xml$” /feed.php?cat=$1 last; rewrite “^/feed-b([0-9]+).xml$” /feed.php?brand=$1 last; rewrite “^/feed.xml$” [...]]]></description>
			<content:encoded><![CDATA[<p>常用的系统在nginx下的伪静态规则。</p>
<p><span id="more-149"></span><br />
<strong>CMS系统</strong></p>
<p>PHPCMS： </p>
<pre class=prettyprint>location / {
###以下为PHPCMS 伪静态化rewrite规则
rewrite ^(.*)show-([0-9]+)-([0-9]+).html$ $1/show.php?itemid=$2&#038;page=$3;
rewrite ^(.*)list-([0-9]+)-([0-9]+).html$ $1/list.php?catid=$2&#038;page=$3;
rewrite ^(.*)show-([0-9]+).html$ $1/show.php?specialid=$2;
} </pre>
<p><strong>商城</strong>shopex</p>
<pre class=prettyprint>

location / {
if (!-e $request_filename) {
rewrite ^/(.+.(html|xml|json|htm|php|jsp|asp|shtml))$ /index.php?$1 last;
}
}
</pre>
<p>ECSHOP</p>
<pre class=prettyprint>
if (!-e $request_filename)
{
rewrite “^/index.html” /index.php last;
rewrite “^/category$” /index.php last;
rewrite “^/feed-c([0-9]+).xml$” /feed.php?cat=$1 last;
rewrite “^/feed-b([0-9]+).xml$” /feed.php?brand=$1 last;
rewrite “^/feed.xml$” /feed.php last;
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /category.php?id=$1&#038;brand=$2&#038;price_min=$3&#038;price_max=$4&#038;filter_attr=$5&#038;page=$6&#038;sort=$7&#038;order=$8 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*).html$” /category.php?id=$1&#038;brand=$2&#038;price_min=$3&#038;price_max=$4&#038;filter_attr=$5 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /category.php?id=$1&#038;brand=$2&#038;page=$3&#038;sort=$4&#038;order=$5 last;
rewrite “^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*).html$” /category.php?id=$1&#038;brand=$2&#038;page=$3 last;
rewrite “^/category-([0-9]+)-b([0-9]+)(.*).html$” /category.php?id=$1&#038;brand=$2 last;
rewrite “^/category-([0-9]+)(.*).html$” /category.php?id=$1 last;
rewrite “^/goods-([0-9]+)(.*).html” /goods.php?id=$1 last;
rewrite “^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /article_cat.php?id=$1&#038;page=$2&#038;sort=$3&#038;order=$4 last;
rewrite “^/article_cat-([0-9]+)-([0-9]+)(.*).html$” /article_cat.php?id=$1&#038;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 “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+).html” /brand.php?id=$1&#038;cat=$2&#038;page=$3&#038;sort=$4&#038;order=$5 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*).html” /brand.php?id=$1&#038;cat=$2&#038;page=$3 last;
rewrite “^/brand-([0-9]+)-c([0-9]+)(.*).html” /brand.php?id=$1&#038;cat=$2 last;
rewrite “^/brand-([0-9]+)(.*).html” /brand.php?id=$1 last;
rewrite “^/tag-(.*).html” /search.php?keywords=$1 last;
rewrite “^/snatch-([0-9]+).html$” /snatch.php?id=$1 last;
rewrite “^/group_buy-([0-9]+).html$” /group_buy.php?act=view&#038;id=$1 last;
rewrite “^/auction-([0-9]+).html$” /auction.php?act=view&#038;id=$1 last;
rewrite “^/exchange-id([0-9]+)(.*).html$” /exchange.php?id=$1&#038;act=view last;
rewrite “^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /exchange.php?cat_id=$1&#038;integral_min=$2&#038;integral_max=$3&#038;page=$4&#038;sort=$5&#038;order=$6 last;
rewrite ^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*).html$” /exchange.php?cat_id=$1&#038;page=$2&#038;sort=$3&#038;order=$4 last;
rewrite “^/exchange-([0-9]+)-([0-9]+)(.*).html$” /exchange.php?cat_id=$1&#038;page=$2 last;
rewrite “^/exchange-([0-9]+)(.*).html$” /exchange.php?cat_id=$1 last;
} 
</pre>
<p>MVMMall</p>
<pre class=prettyprint>
	rewrite ^/brand-view-([0-9]+).html$ /;
	rewrite ^/brand-view-([0-9]+)-([0-9]+).html$ /;
	rewrite ^/auction-view-([0-9]+).html$ /;
	rewrite ^/group-view-([0-9]+).html$ /;
	rewrite ^/article-(.*)-([0-9]+).html$ /;
	rewrite ^/([a-z]+)-(.*)-([0-9]+).html$ /;
	rewrite ^/index.html$ /;
	rewrite ^/sitemap.html$ /;
	rewrite ^/lackcheck.html$ /;
	rewrite ^/search.html$ /;
	rewrite ^/search.html$ /;
	rewrite ^/register.html$ /;
</pre>
<p><strong>博客</strong><br />
WordPress</p>
<pre class=prettyprint>
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;
}
}
</pre>
<p><strong>论坛</strong><br />
PHPwind</p>
<pre class=prettyprint>
location / {
####以下为PHPWind 伪静态化rewrite规则
rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
rewrite ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2 last;
}
</pre>
<p>discuz</p>
<pre class=prettyprint>
rewrite ^/archiver/((fid|tid)-[w-]+.html)$ /archiver/index.php?$1 last;
rewrite ^/forum-([0-9]+)-([0-9]+).html$ /forumdisplay.php?fid=$1&#038;page=$2 last;
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ /viewthread.php?tid=$1&#038;extra=page%3D$3&#038;page=$2 last;
rewrite ^/tag-(.+).html$ /tag.php?name=$1 last;
</pre>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li><a href="http://www.mrzeng.com/post/windows-nginx-php.html" title="在windows上安装nginx+php环境">在windows上安装nginx+php环境</a><br /><small>目前，nginx以其独特的性能越来越博得喜爱，LNMP环境逐步代替了LAMP环境。Nginx从v0.7.52也开始支持windows环境。接下来简要介绍些安装方法。

1、准备好安装软件
    Nginx ：我们选用最新的稳定版本0.7.65。http://nginx.org/download/nginx-0.7.65.zip
      PHP:http://www.php.net/g...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mrzeng.com/post/nginx-rewrite-in-common-systems.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在windows上安装nginx+php环境</title>
		<link>http://www.mrzeng.com/post/windows-nginx-php.html</link>
		<comments>http://www.mrzeng.com/post/windows-nginx-php.html#comments</comments>
		<pubDate>Sat, 20 Feb 2010 13:13:53 +0000</pubDate>
		<dc:creator>zenghuashui</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mrzeng.com/?p=139</guid>
		<description><![CDATA[目前，nginx以其独特的性能越来越博得喜爱，LNMP环境逐步代替了LAMP环境。Nginx从v0.7.52也开始支持windows环境。接下来简要介绍些安装方法。 1、准备好安装软件 Nginx ：我们选用最新的稳定版本0.7.65。http://nginx.org/download/nginx-0.7.65.zip PHP:http://www.php.net/get/php-5.2.12-Win32.zip/from/a/mirror RunHiddenConsole：用来隐藏dos窗口。http://blogbuildingu.com/files/RunHiddenConsole.zip 2、创建安装目录 在c盘创建php5和Nginx文件夹。 3、安装Nginx 将nginx解压出来，将里面的文件拷贝到Nginx文件夹里面。 4、安装PHP 将php的文件解压出来，全部拷贝到php5文件夹里面。把RunHiddenConsole.exe 也拷贝进来。 5、配置 （1）打开php5文件夹，找到的 php.ini-recommended，更名为 php.ini，打开，推荐用EditPlus打开： 找到; cgi.fix_pathinfo=1，去掉前面的; 找到 ;extension=php_gd2.dll ;extension=php_mysql.dll ;extension=php_mysqli.dll 把前面的;去掉，这样就能支持gd图形、mysql数据库连接，如果需要其他的扩展功能，可以去掉对应的;即可 （2）将C:\php5加到path里面。 （3）找到nginx文件夹下的conf，双击进入该文件夹， 找到nginx.conf文件， #location ~ .php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} 把里面的#去掉。并将/scripts替换为 $document_root 其中root可以随意指定你所要的目录，特别要注意和 location / { root [...]]]></description>
			<content:encoded><![CDATA[<p>目前，nginx以其独特的性能越来越博得喜爱，LNMP环境逐步代替了LAMP环境。Nginx从v0.7.52也开始支持windows环境。接下来简要介绍些安装方法。<br />
<span id="more-139"></span><br />
1、准备好安装软件<br />
    Nginx ：我们选用最新的稳定版本0.7.65。http://nginx.org/download/nginx-0.7.65.zip<br />
      PHP:http://www.php.net/get/php-5.2.12-Win32.zip/from/a/mirror<br />
      RunHiddenConsole：用来隐藏dos窗口。http://blogbuildingu.com/files/RunHiddenConsole.zip<br />
2、创建安装目录<br />
   在c盘创建php5和Nginx文件夹。<br />
3、安装Nginx<br />
    将nginx解压出来，将里面的文件拷贝到Nginx文件夹里面。<br />
4、安装PHP<br />
   将php的文件解压出来，全部拷贝到php5文件夹里面。把RunHiddenConsole.exe 也拷贝进来。<br />
5、配置<br />
   （1）打开php5文件夹，找到的 php.ini-recommended，更名为 php.ini，打开，推荐用EditPlus打开：<br />
        找到; cgi.fix_pathinfo=1，去掉前面的;<br />
        找到<br />
             ;extension=php_gd2.dll<br />
                  ;extension=php_mysql.dll<br />
                 ;extension=php_mysqli.dll</p>
<p>          把前面的;去掉，这样就能支持gd图形、mysql数据库连接，如果需要其他的扩展功能，可以去掉对应的;即可<br />
    （2）将C:\php5加到path里面。<br />
    （3）找到nginx文件夹下的conf，双击进入该文件夹， 找到nginx.conf文件，</p>
<pre class=prettyprint>
        #location ~ .php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}
</pre>
<p>把里面的#去掉。并将/scripts替换为 $document_root<br />
 其中root可以随意指定你所要的目录，特别要注意和<br />
location / {<br />
            root   html;<br />
            index  index.html index.htm;<br />
        }<br />
里面的root保持一致。否则会出错。</p>
<p>6、用命令行启动。<br />
   随便找一个目录，桌面也可以，常用的即可。新建文本文件start_nginx.bat批处理文件来启动nginx和php。内容如下</p>
<pre class=prettyprint>
@echo off
REM Windows 下无效
REM set PHP_FCGI_CHILDREN=5

REM 每个进程处理的最大请求数，或设置为 Windows 环境变量
set PHP_FCGI_MAX_REQUESTS=1000

echo Starting PHP FastCGI...
RunHiddenConsole C:/php5/php-cgi.exe -b 127.0.0.1:9000 -c C:/php5/php.ini

echo Starting nginx...
C:/nginx/nginx.exe
</pre>
<p>同样 stop_nginx.bat，用来关闭：</p>
<pre class=prettyprint>
@echo off
echo Stopping nginx...
taskkill /F /IM nginx.exe &gt; nul
echo Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe &gt; nul
exit
</pre>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li><a href="http://www.mrzeng.com/post/nginx-rewrite-in-common-systems.html" title="常用的PHP系统在nginx下的伪静态规则">常用的PHP系统在nginx下的伪静态规则</a><br /><small>常用的系统在nginx下的伪静态规则。


CMS系统
 
PHPCMS： 
location / { 
###以下为PHPCMS 伪静态化rewrite规则 
rewrite ^(.*)show-([0-9]+)-([0-9]+)\.html$ $1/show.php?itemid=$2&page=$3; 
rewrite ^(.*)list-([0-9]+)-([0-9]+)...</small></li><li><a href="http://www.mrzeng.com/post/vertrigoserv0717.html" title="Windows 下环境迅速搭建Php+Apache+mysql">Windows 下环境迅速搭建Php+Apache+mysql</a><br /><small>本文发表于计世网服务器论坛。http://serverbbs.ccw.com.cn/viewthread.php?tid=15141&amp;highlight=%2Byeying43

php在windows条件下要进行一系列配置，操作比较麻烦，而且容易出错。现在推荐一款软件，不仅可以轻松搭建php环境，而其可以对php环境进行很好配置和管理。
软件名字：VertrigoServ
最新版...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mrzeng.com/post/windows-nginx-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

