This article describes, nginx as a web cache configuration, there is a need for friends to refer to it.
Use nginx as the web cache between the content source web server and the client.
Web Cache Solution: 1 Squid Cache 2 Nginx's proxy_cache
First, Nginx's proxy_cache consists of: proxy_cache related instruction set, fastcgi related instruction set
Proxy_cache which buffer will be used proxy_cache_path cache file storage path proxy_cache_methods cache HTTP method proxy_cache_min_users cache minimum usage proxy_cache_valid set different cache time for different return status code URL proxy_cache_key set cache key value, Nginx hash according to key value Cache
Install third-party ngx_cache_purge module: Delete the specified url cache Nginx web cache service
Step 1: ulimit -SHn 65535 Install pcre ./configure && make && Make install Install ngx_cache_purge Just unzip it Install
Code sample:
nginx ./configure --user=www --group=www --add-module=../ngx_cache_purge - -prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_model && make && make install
Step 2: Create 2 Cache Directories
Code Example:
mkdir -p /data0/proxy_temp_path mkdir -p /data0/proxy_cache_path
Steps Three: Configuring the cache of nginx.conf
Code example:
http{ ... proxy_temp_path ...; proxy_cache_path ...; server{ ... proxy_cache cache_name; proxy_cache_valid ... ; proxy_cache_key ...; } }
For the configuration of nginx cache, here are a few articles recommended, you can also refer to the following: nginx cache configuration example Nginx set static file cache time nginx cache local static file nginx five kinds Cache mode nginx cache static file method nginx proxy_cache cache configuration Nginx front-end proxy, cache
Next, fastcgi cache configuration.
Parameter Description:
fastcgi_cache Which cache is used by the cache fastcgi_cache_path Set the storage path of the cache file fastcgi_cache_methodes Set which HTTP methods to cache, default HTTP GET/HEAD method fastcgi_cache_min_users Set the minimum usage count of the cache, default 1 fastcgi_cache_valid Set different cache time for URLs returning different status codes fastcgi_cache_key Set the key value of the web cache, nginx hashes the cache according to the key value md5
Step 1: Create a cache directory: the cache path must be in the same Disk Partitions
Code Example:
mkdir -p /data0/fastcgi_temp_path mkdir -p /data0/fastcgi_cache_path
Step 2:
Code Example: Br>
Nginx configuration file http{ ... fastcgi_temp_path ...; fastcgi_cache_path ...; server{ ... fastcgi_cache cache_name; fastcgi_cache_valid ...; fastcgi_cache_key ...; } }
Problem DescriptionHow to delete arrays in LSI 8708E SAS RAID card management soft
Each time the server receives a request, it must be processed by IIS. This is not
Introduction: The full name of PWS is Personal Web Server, which is
Anyone who knows about the network knows that dual network cards can
Application Load Balancing - Double the speed of your diskless station connection
There is no .NET2.0 option card solution in IIS
VPS common security settings (linux)
Apache configuration independent domain name method
What do the 1U and 2U in the server mean?
Let IIS support the download of .apk files
Resolving NLB/CLB/MSCS Cluster Clusters
The key to server virtual integration: management automation
Lack of .net2.0 and vc9 causes some software to be installed.
Win8.1 system task manager startup items show unmetered how to deal with?
Where is the Win10 Recycle Bin? How to modify the capacity of the Win10 recycle bin
Why upgrade? 10 reasons to upgrade to win 2003
Win10 system how to add Office desktop shortcut icon
Linux command: Change access to files or directories
Tips for quickly capturing pop-up menus under Win8
Win10 crashes when a new folder is created