日志标签:nginx缓存

使用Nginx的proxy_cache缓存静态文件

分类:运维技术日期:2012-03-15 - 20:41:49评论:9条作者:老谢

咦?我不是该在学习ccnp的路由部分么?为什么又搞上nginx了?啊!蛋开始痛了。。写完这篇继续看我的np去,Orz…

安装Nginx — 更详细的请看:http://www.xj123.info/2416.html

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
tar -zxf pcre-8.30.tar.gz
wget http://sourceforge.net/projects/libpng/files/zlib/1.2.6/zlib-1.2.6.tar.gz/download
tar -zxf zlib-1.2.6.tar.gz
wget http://labs.frickle.com/files/ngx_cache_purge-1.5.tar.gz
tar -zxf ngx_cache_purge-1.5.tar.gz
wget http://nginx.org/download/nginx-1.0.13.tar.gz
tar -zxf nginx-1.0.13.tar.gz
cd nginx-1.0.13
./configure --prefix=/usr/local/nginx \
--user=www \
--group=www \
--with-http_ssl_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_realip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-mail --with-mail_ssl_module \
--with-pcre=../pcre-8.30 \
--with-zlib=../zlib-1.2.6 \
--add-module=../ngx_cache_purge-1.5 \
--with-debug \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--http-scgi-temp-path=/var/tmp/nginx/scgi 
make && make install
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/
mkdir /var/tmp/nginx/cache

配置文件直接贴出来了,俺也不怕丑了。。(#号后面的内容为注释)

继续阅读…