前言* Nginx已经具备Squid所拥有的Web缓存加速功能、清除指定URL缓存的功能。而在性能上,Nginx对多核CPU的利用,胜过Squid不少。另外,在反向代理、负载均衡、健康检查、后端服务器故障转移、Rewrite重写、易用性上,Nginx也比Squid强大得多。这使得一台Nginx可以同时作为“负载均衡服务器”与“Web缓存服务器”来使用。 一、 安装nginx和ngx-purge ulimit -SHn 65535 yum install pcre pcre-devel -y 安装pcre wget http://labs.frickle.com/files/ngx_cache_purge-1.4.tar.gz tar zxvf ngx_cache_purge-1.4.tar.gz wget http://nginx.org/download/nginx-1.0.11.tar.gz tar zxvf nginx-1.0.11.tar.gz cd nginx-1.0.11/ ./configure --user=www--group=www--add-module=../ngx_cache_purge-1.4 --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module make && make install cd ../ 二、 配置nginx.conf文件如下配置文件 user www www; worker_processes 8; error_log /data/logs/nginx/error.log crit; pid /usr/local/nginx/nginx.pid; #Specifies the value for maximum file descriptors [...]