首先下载源码包
wget http://nginx.org/download/nginx-1.8.0.tar.gz
解压并进入源码包目录
yum install pcre pcre-devel zlib zlib-devel
./configure --prefix=/usr/local/nginx
make && make install
到此Nginx安装就搞定了
如果想在编译安装结束后重新加入新的模块(以ngx_http_consistent_hash为例)
官方wiki:http://wiki.nginx.org/HttpUpstreamConsistentHash
wget https://github.com/replay/ngx_http_consistent_hash/archive/master.zip
/usr/local/src/nginx-1.8.0/configure --prefix=/usr/local/nginx --add-module=/usr/local/src/ngx_http_consistent_hash-master/
make && make install
搞定,就是这么简单