#图片浏览cacheproxy_cache_path/var/cache/nginx/imgcache levels=2:2:2 keys_zone=imgcache:256m inactive=7d max_size=0m; server{Listen 80; server_name img.xxxx.net; root/data/www/; Location ~ \. (Jpg|jpeg|jp2|png|gif|bmp|ico|wbmp|xbm|tiff) (/\d*)? (/\d*)? (\?. *) $ {Proxy_pass http://127.0.0.1:8118; Proxy_cache Imgcache; Proxy_cache_key $host $uri; Proxy_set_header host inner.img.xxxx.com; Proxy_cache_valid 30d; Proxy_cache_valid any 1m; Expires 30d; } Access_log/var/log/nginx/img_cache.log main; Error_log/var/log/nginx/img_cache.log.err Debug;} server{Listen 8118; server_name inner.img.xxxx.net; root/data/www/; Location ~ \. (Jpg|jpeg|jp2|png|gif|bmp|ico|wbmp|xbm|tiff) (/\d*)? (/\d*)? (\?. *) $ {Fastcgi_pass unix:/var/run/php-cgi.sock; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; Rewrite ^/(.*) $/app/image/index.php?mod=download break; Expires 7d; } Access_log/var/log/nginx/img_download.log main; Error_log/var/log/nginx/img_download.log.err Debug;}
The above describes Nginx as a picture browser front-end cache configuration example, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.