標籤:
需要使用到的第三方模組,因為在有道筆記上面,所以為辦法直接給你們,需要的話給我私信或者郵件([email protected])
1.編譯安裝,添加上述擴充外掛程式./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-openssl=/usr/ --with-pcre=/usr/local/src/pcre-8.31 --with-http_stub_status_module --add-module=/usr/local/src/ngx_devel_kit-master --add-module=/usr/local/src/set-misc-nginx-module-0.29 --add-module=/usr/local/src/srcache-nginx-module-0.30 --add-module=/usr/local/src/redis2-nginx-module-0.12 --add-module=/usr/local/src/echo-nginx-module-0.58 2.修改nginx.conf配置location ~ .*\.php { root html; srcache_store_private on; srcache_methods GET; srcache_response_cache_control off; if ($uri ~ .*\.php$){ set $key $request_uri; set_escape_uri $escaped_key $key; srcache_fetch GET /redis $key; srcache_default_expire 172800; srcache_store PUT /redis2 key=$escaped_key&exptime=$srcache_expire; } include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; } location = /redis { internal; set_md5 $redis_key $args; redis2_pass 127.0.0.1:6379; } location = /redis2 { internal; set_unescape_uri $exptime $arg_exptime; set_unescape_uri $key $arg_key; set_md5 $key; redis2_query set $key $echo_request_body; redis2_query expire $key $exptime; redis2_pass 127.0.0.1:6379; } 3.redis檢查是否產生key值redis-clikeys *infodbsize
9.nginx使用redis用緩衝