9.nginx使用redis用緩衝

來源:互聯網
上載者:User

標籤:

需要使用到的第三方模組,因為在有道筆記上面,所以為辦法直接給你們,需要的話給我私信或者郵件([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用緩衝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.