I. Installing a dependency package
Each installation of the software must, by default, a few packages, must be installed
Yum install autoconf automake zlib zlib-devel OpenSSL openssl-devel pcre pcre-devel gcc
Two. Download Nginx and related modules
nginx: You can go to the official website http://nginx.org/Download the latest version
wget http://nginx.org/download/nginx-1.7.8.tar.gz
Cache Module Ngx_cache_purge: can go to http://labs.frickle.com/nginx_ngx_cache_purge/download the latest version
wget http://labs.frickle.com/files/ngx_cache_purge-2.2.tar.gz
# Unzip the tar zxvf nginx-1.7.8. Tar.gztar zxvf ngx_cache_purge-2.2.tar.gz
Three. Compiling the installation
./--user=www--group=--with---with---with---with---with- --add-module=. /ngx_cache_purge-2.2& make Install
After installation, the default nginx root directory is /usr/local/nginx
Four. Cache Configuration Example
Nginx configuration is a lot of examples, do not repeat, directly asked degrees Niang bar.
For example, use a cache:
Proxy_cache_path /tmp/cache keys_zone=/ { proxy_pass http://127.0.0.1:8000 ; Proxy_cache Tmpcache; Proxy_cache_key $uri $is_args$args; Proxy_cache_purge 127.0.0.1;}
Installing Nginx under Linux