<?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>LinuxByte &#187; nginx</title>
	<atom:link href="http://www.linuxbyte.org/tag/nginx/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxbyte.org</link>
	<description>一个Linux Blog</description>
	<lastBuildDate>Tue, 22 Jun 2010 15:10:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nginx下实现gzip静态文件压缩</title>
		<link>http://www.linuxbyte.org/nginx-shixian-gzip-jingtai-wenjian-yasuo.html</link>
		<comments>http://www.linuxbyte.org/nginx-shixian-gzip-jingtai-wenjian-yasuo.html#comments</comments>
		<pubDate>Wed, 04 Feb 2009 12:25:35 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[服务器应用]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/?p=366</guid>
		<description><![CDATA[别地方抄来的留个备份
nginx要修改两处，在虚拟主机配置段中添加：

location ~* ^.+.gzjs$ &#123;
add_header Content-Encoding gzip;
gzip off;
&#125;

另外再修改nginx的mime文件，在application/x-javascript js;中添加gzjs
... ]]></description>
			<content:encoded><![CDATA[<p>别地方抄来的留个备份<br />
nginx要修改两处，在虚拟主机配置段中添加：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">location ~<span style="color: #000000; font-weight: bold;">*</span> ^.+.gzjs$ <span style="color: #7a0874; font-weight: bold;">&#123;</span>
add_header Content-Encoding <span style="color: #c20cb9; font-weight: bold;">gzip</span>;
<span style="color: #c20cb9; font-weight: bold;">gzip</span> off;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>另外再修改nginx的mime文件，在application/x-javascript js;中添加gzjs</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">application<span style="color: #000000; font-weight: bold;">/</span>x-javascript js gzjs;</pre></div></div>

<h3  class="related_post_title">与本文关系暧昧的文字</h3><ul class="related_post"><li><a href="http://www.linuxbyte.org/nginx-install.html" title="Nginx 安装">Nginx 安装</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2009<br />
Source: <a href="http://www.linuxbyte.org/nginx-shixian-gzip-jingtai-wenjian-yasuo.html">Nginx下实现gzip静态文件压缩</a><br />
<a href="http://www.linuxbyte.org/nginx-shixian-gzip-jingtai-wenjian-yasuo.html#comments">No comment</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/gzip" rel="tag">gzip</a>, <a href="http://www.linuxbyte.org/tag/nginx" rel="tag">nginx</a><br/>
</small></p>
	标签：<a href="http://www.linuxbyte.org/tag/gzip" title="gzip" rel="tag">gzip</a>, <a href="http://www.linuxbyte.org/tag/nginx" title="nginx" rel="tag">nginx</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.linuxbyte.org/nginx-install.html" title="Nginx 安装 (2008-02-12)">Nginx 安装</a> (0)</li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/nginx-shixian-gzip-jingtai-wenjian-yasuo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx 安装</title>
		<link>http://www.linuxbyte.org/nginx-install.html</link>
		<comments>http://www.linuxbyte.org/nginx-install.html#comments</comments>
		<pubDate>Tue, 12 Feb 2008 07:13:18 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[服务器应用]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/nginx-install</guid>
		<description><![CDATA[Nginx在一些Linux发行版和BSD的各个变种版本的安装包仓库中都会有，通过各个系统自带的软件包管理方法即可安装。需要注意的是，很多预先编译好的安装包都比较陈旧，大多数情况下还是推荐... ]]></description>
			<content:encoded><![CDATA[<p>预先编译好的安装包<br />
Nginx在一些Linux发行版和BSD的各个变种版本的安装包仓库中都会有，通过各个系统自带的软件包管理方法即可安装。需要注意的是，很多预先编译好的安装包都比较陈旧，大多数情况下还是推荐直接从源码编译。</p>
<p>官方源代码下载<br />
<a href="http://sysoev.ru/nginx/download.html">http://sysoev.ru/nginx/download.html</a><br />
<span id="more-4"></span></p>
<p>使用源代码进行构建<br />
Nginx 使用 Unix 下常用的 &#8216;./configure &amp;&amp; make &amp;&amp; make install&#8217; 过程来编译安装。</p>
<p>configure 脚本确定系统所具有一些特性，特别是 nginx 用来处理连接的方法。然后，它创建 Makefile 文件。</p>
<p>configure 支持下面的选项：</p>
<p>&#8211;prefix=&lt;path&gt; &#8211; Nginx安装路径。如果没有指定，默认为 /usr/local/nginx。</p>
<p>&#8211;sbin-path=&lt;path&gt; &#8211; Nginx可执行文件安装路径。只能安装时指定，如果没有指定，默认为&lt;prefix&gt;/sbin/nginx。</p>
<p>&#8211;conf-path=&lt;path&gt; &#8211; 在没有给定-c选项下默认的nginx.conf的路径。如果没有指定，默认为&lt;prefix&gt;/conf/nginx.conf。</p>
<p>&#8211;pid-path=&lt;path&gt; &#8211; 在nginx.conf中没有指定pid指令的情况下，默认的nginx.pid的路径。如果没有指定，默认为 &lt;prefix&gt;/logs/nginx.pid。</p>
<p>&#8211;lock-path=&lt;path&gt; &#8211; nginx.lock文件的路径。</p>
<p>&#8211;error-log-path=&lt;path&gt; &#8211; 在nginx.conf中没有指定error_log指令的情况下，默认的错误日志的路径。如果没有指定，默认为 &lt;prefix&gt;/logs/error.log。</p>
<p>&#8211;http-log-path=&lt;path&gt; &#8211; 在nginx.conf中没有指定access_log指令的情况下，默认的访问日志的路径。如果没有指定，默认为 &lt;prefix&gt;/logs/access.log。</p>
<p>&#8211;user=&lt;user&gt; &#8211; 在nginx.conf中没有指定user指令的情况下，默认的nginx使用的用户。如果没有指定，默认为 nobody。</p>
<p>&#8211;group=&lt;group&gt; &#8211; 在nginx.conf中没有指定user指令的情况下，默认的nginx使用的组。如果没有指定，默认为 nobody。</p>
<p>&#8211;builddir=DIR &#8211; 指定编译的目录</p>
<p>&#8211;with-rtsig_module &#8211; 启用 rtsig 模块</p>
<p>&#8211;with-select_module &#8211;without-select_module &#8211; Whether or not to enable the select module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure.</p>
<p>//允许或不允许开启SELECT模式，如果 configure 没有找到更合适的模式，比如：kqueue(sun os),epoll (linux kenel 2.6+), rtsig(实时信号)或者/dev/poll(一种类似select的模式，底层实现与SELECT基本相 同，都是采用轮训方法) SELECT模式将是默认安装模式</p>
<p>&#8211;with-poll_module &#8211;without-poll_module &#8211; Whether or not to enable the poll module. This module is enabled by default if a more suitable method such as kqueue, epoll, rtsig or /dev/poll is not discovered by configure.</p>
<p>&#8211;with-http_ssl_module &#8211; Enable ngx_http_ssl_module. Enables SSL support and the ability to handle HTTPS requests. Requires OpenSSL. On Debian, this is libssl-dev.</p>
<p>//开启HTTP SSL模块，使NGINX可以支持HTTPS请求。这个模块需要已经安装了OPENSSL，在DEBIAN上是libssl</p>
<p>&#8211;with-http_realip_module &#8211; 启用 ngx_http_realip_module</p>
<p>&#8211;with-http_addition_module &#8211; 启用 ngx_http_addition_module</p>
<p>&#8211;with-http_sub_module &#8211; 启用 ngx_http_sub_module</p>
<p>&#8211;with-http_dav_module &#8211; 启用 ngx_http_dav_module</p>
<p>&#8211;with-http_flv_module &#8211; 启用 ngx_http_flv_module</p>
<p>&#8211;with-http_stub_status_module &#8211; 启用 &#8220;server status&#8221; 页</p>
<p>&#8211;without-http_charset_module &#8211; 禁用 ngx_http_charset_module</p>
<p>&#8211;without-http_gzip_module &#8211; 禁用 ngx_http_gzip_module. 如果启用，需要 zlib 。</p>
<p>&#8211;without-http_ssi_module &#8211; 禁用 ngx_http_ssi_module</p>
<p>&#8211;without-http_userid_module &#8211; 禁用 ngx_http_userid_module</p>
<p>&#8211;without-http_access_module &#8211; 禁用 ngx_http_access_module</p>
<p>&#8211;without-http_auth_basic_module &#8211; 禁用 ngx_http_auth_basic_module</p>
<p>&#8211;without-http_autoindex_module &#8211; 禁用 ngx_http_autoindex_module</p>
<p>&#8211;without-http_geo_module &#8211; 禁用 ngx_http_geo_module</p>
<p>&#8211;without-http_map_module &#8211; 禁用 ngx_http_map_module</p>
<p>&#8211;without-http_referer_module &#8211; 禁用 ngx_http_referer_module</p>
<p>&#8211;without-http_rewrite_module &#8211; 禁用 ngx_http_rewrite_module. 如果启用需要 PCRE 。</p>
<p>&#8211;without-http_proxy_module &#8211; 禁用 ngx_http_proxy_module</p>
<p>&#8211;without-http_fastcgi_module &#8211; 禁用 ngx_http_fastcgi_module</p>
<p>&#8211;without-http_memcached_module &#8211; 禁用 ngx_http_memcached_module</p>
<p>&#8211;without-http_limit_zone_module &#8211; 禁用 ngx_http_limit_zone_module</p>
<p>&#8211;without-http_empty_gif_module &#8211; 禁用 ngx_http_empty_gif_module</p>
<p>&#8211;without-http_browser_module &#8211; 禁用 ngx_http_browser_module</p>
<p>&#8211;without-http_upstream_ip_hash_module &#8211; 禁用 ngx_http_upstream_ip_hash_module</p>
<p>&#8211;with-http_perl_module &#8211; 启用 ngx_http_perl_module</p>
<p>&#8211;with-perl_modules_path=PATH &#8211; 指定 perl 模块的路径</p>
<p>&#8211;with-perl=PATH &#8211; 指定 perl 执行文件的路径</p>
<p>&#8211;http-log-path=PATH &#8211; Set path to the http access log</p>
<p>&#8211;http-client-body-temp-path=PATH &#8211; Set path to the http client request body temporary files</p>
<p>&#8211;http-proxy-temp-path=PATH &#8211; Set path to the http proxy temporary files</p>
<p>&#8211;http-fastcgi-temp-path=PATH &#8211; Set path to the http fastcgi temporary files</p>
<p>&#8211;without-http &#8211; 禁用 HTTP server</p>
<p>&#8211;with-mail &#8211; 启用 IMAP4/POP3/SMTP 代理模块</p>
<p>&#8211;with-mail_ssl_module &#8211; 启用 ngx_mail_ssl_module</p>
<p>&#8211;with-cc=PATH &#8211; 指定 C 编译器的路径</p>
<p>&#8211;with-cpp=PATH &#8211; 指定 C 预处理器的路径</p>
<p>&#8211;with-cc-opt=OPTIONS &#8211; Additional parameters which will be added to the variable CFLAGS. With the use of the system library PCRE in FreeBSD, it is necessary to indicate &#8211;with-cc-opt=&#8221;-I /usr/local/include&#8221;. If we are using select() and it is necessary to increase the number of file descriptors, then this also can be assigned here: &#8211;with-cc-opt=&#8221;-D FD_SETSIZE=2048&#8243;.</p>
<p>&#8211;with-ld-opt=OPTIONS &#8211; Additional parameters passed to the linker. With the use of the system library PCRE in FreeBSD, it is necessary to indicate &#8211;with-ld-opt=&#8221;-L /usr/local/lib&#8221;.</p>
<p>&#8211;with-cpu-opt=CPU &#8211; 为特定的 CPU 编译，有效的值包括：pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64</p>
<p>&#8211;without-pcre &#8211; 禁止 PCRE 库的使用。同时也会禁止 HTTP rewrite 模块。在 &#8220;location&#8221; 配置指令中的正则表达式也需要 PCRE 。</p>
<p>&#8211;with-pcre=DIR &#8211; 指定 PCRE 库的源代码的路径。</p>
<p>&#8211;with-pcre-opt=OPTIONS &#8211; Set additional options for PCRE building.</p>
<p>&#8211;with-md5=DIR &#8211; Set path to md5 library sources.</p>
<p>&#8211;with-md5-opt=OPTIONS &#8211; Set additional options for md5 building.</p>
<p>&#8211;with-md5-asm &#8211; Use md5 assembler sources.</p>
<p>&#8211;with-sha1=DIR &#8211; Set path to sha1 library sources.</p>
<p>&#8211;with-sha1-opt=OPTIONS &#8211; Set additional options for sha1 building.</p>
<p>&#8211;with-sha1-asm &#8211; Use sha1 assembler sources.</p>
<p>&#8211;with-zlib=DIR &#8211; Set path to zlib library sources.</p>
<p>&#8211;with-zlib-opt=OPTIONS &#8211; Set additional options for zlib building.</p>
<p>&#8211;with-zlib-asm=CPU &#8211; Use zlib assembler sources optimized for specified CPU, valid values are: pentium, pentiumpro</p>
<p>&#8211;with-openssl=DIR &#8211; Set path to OpenSSL library sources</p>
<p>&#8211;with-openssl-opt=OPTIONS &#8211; Set additional options for OpenSSL building</p>
<p>&#8211;with-debug &#8211; 启用调试日志</p>
<p>&#8211;add-module=PATH &#8211; Add in a third-party module found in directory PATH</p>
<p>在不同版本间，选项可能会有些许变化，请总是使用 ./configure &#8211;help 命令来检查一下当前的选项列表。</p>
<p>示例 (最好能在同一行)：<br />
    ./configure \<br />
        &#8211;sbin-path=/usr/local/nginx/nginx \<br />
        &#8211;conf-path=/usr/local/nginx/nginx.conf \<br />
        &#8211;pid-path=/usr/local/nginx/nginx.pid \<br />
        &#8211;with-http_ssl_module \<br />
        &#8211;with-pcre=../pcre-4.4 \<br />
        &#8211;with-zlib=../zlib-1.1.3<br />
Example on Ubuntu/debian with libgcrypt11-dev, libpcre3-dev and libssl-dev installed (choose EITHER &#8211;with-md5 OR &#8211;with-sha1, but not both; on debian and ubuntu, they should both point to /usr/lib)<br />
     ./configure &#8211;with-openssl=/usr/lib/ssl/ &#8211;with-md5=/usr/lib<br />
An Ubuntu Edgy .deb for version 0.5.2 can be found here: nginx_0.5.2-1_i386.deb.</p>
<p>(NOTE: According to an October 2006 message md5 was used in a now broken http cache module and sha1 is used in an incomplete mysql library module and so are currently not needed.)</p>
<h3  class="related_post_title">与本文关系暧昧的文字</h3><ul class="related_post"><li><a href="http://www.linuxbyte.org/nginx-shixian-gzip-jingtai-wenjian-yasuo.html" title="Nginx下实现gzip静态文件压缩">Nginx下实现gzip静态文件压缩</a></li><li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化">针对Web服务器总体优化</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2008<br />
Source: <a href="http://www.linuxbyte.org/nginx-install.html">Nginx 安装</a><br />
<a href="http://www.linuxbyte.org/nginx-install.html#comments">No comment</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/nginx" rel="tag">nginx</a>, <a href="http://www.linuxbyte.org/tag/web" rel="tag">web</a>, <a href="http://www.linuxbyte.org/tag/%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ba%94%e7%94%a8" rel="tag">服务器应用</a><br/>
</small></p>
	标签：<a href="http://www.linuxbyte.org/tag/nginx" title="nginx" rel="tag">nginx</a>, <a href="http://www.linuxbyte.org/tag/web" title="web" rel="tag">web</a>, <a href="http://www.linuxbyte.org/tag/%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ba%94%e7%94%a8" title="服务器应用" rel="tag">服务器应用</a><br />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.linuxbyte.org/zhen-dui-webfu-wu-qi-zong-ti-you-hua.html" title="针对Web服务器总体优化 (2008-06-07)">针对Web服务器总体优化</a> (0)</li>
	<li><a href="http://www.linuxbyte.org/nginx-shixian-gzip-jingtai-wenjian-yasuo.html" title="Nginx下实现gzip静态文件压缩 (2009-02-04)">Nginx下实现gzip静态文件压缩</a> (0)</li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/nginx-install.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
