Nginx系列教程:HTTP Memcached模块

ngx_http_memcached_module

你可以利用本模块来进行简单的5603.html">缓存以提高系统效率。本模块计划在未来进行扩展。

__配置示例__

server {: location / {: set $memcached_key $uri;: memcached_pass name:11
211;: default_type text/html;: error_page 404 = /fallback;: }: location = /fallback {: proxy_pass backend;: }}

指令

[#memcached_pass memcached_pass] [#memcached_connect_timeout memcached_connect_timeout] [#memcached_send_timeout memcached_send_timeout] [#memcached_read_timeout memcached_read_timeout] [#memcached_buffer_size memcached_buffer_size] [#memcached_next_upstream memcached_next_upstream]

变量

$memcached_key

memcached_pass

语法: memcached_pass [ name:port ]

默认值: none

作用域: http, server, location

The backend should set the data in memcached. The memcached key is "/uri?args".

Since 0.5.9 the memcached key is now in $memcached_key.

memcached_connect_timeout

语法: memcached_connect_timeout [ time ]

默认值: 60000

作用域: http, server, location

The timeout for connecting to memcached, in milliseconds.

memcached_read_timeout

语法: memcached_read_timeout [ time ]

默认值: 60000

作用域: http, server, location

The timeout for reading from memcached, in milliseconds.

memcached_send_timeout

语法: memcached_send_timeout [ time ]

默认值: 60000

作用域: http, server, location

The timeout for sending to memcached, in milliseconds.

memcached_buffer_size

语法: memcached_buffer_size [ size ]

默认值: see getpagesize(2)

作用域: http, server, location

The recv/send buffer size, in bytes.

memcached_next_upstream

语法: memcached_next_upstream [ error | timeout | invalid_response | not_found | off ]

默认值: error timeout

作用域: http, server, location

Which failure conditions should cause the request to be forwarded to another upstream server? Applies only when the value in memcached_pass is an upstream with two or more servers.

时间: 2024-07-31 09:26:33

Nginx系列教程:HTTP Memcached模块的相关文章

Nginx系列教程:nginx_module_development模块开发

好像这是唯一的一份模块开发文档.. 以下简称 guide 读代码!! nginx 程序启动 把 nginx.conf 读入内存 处理模块 ngx_http_module_t 定义的 configuration. 应该是如下的执行顺序 pre create_main_conf 执行 ngx_command_t 里面定义的函数. 可以视为 init_main_conf 的自动处理部分 init_main_conf ... postconfig listen fork 子进程(真正的服务器进程 mas

Nginx系列教程:nginx_substitutions_filter模块

nginx_substitutions_filter 请注意:此模块不是Nginx源的分布,可点击此链接找到安装说明, http://wiki.nginx.org/NginxHttpSubsModule#Installation . 概述 nginx_substitutions_filter 是一个过滤器模块,它可以在响应主体上运行正则表达式和固定字符串替换.该 模块不同于Nginx的本地替代模块.它能够扫描输出链缓冲区和匹配逐行字符串,类似于http://www.aliyun.com/zixu

Nginx系列教程:ngx_cache_purge模块

ngx_cache_purge 本模块由第三方提供,不包含在 Nginx 的源码发布版中. 概述 ngx_cache_purge是nginx模块,用于从FastCGI.proxy.SCGI 和uWSGI5603.html">缓存中增加内容清除功能. 安装 下载模块源码:ngx_cache_purge-1.2(更新记录)(SHA1: d9468cf42432e81ea3a110ec63aae2eb273f5516) 其他版本 解压,然后编译: ./configuremake &&am

Nginx系列教程:HTTP模块

控制Nginx HTTP 进程的核心属性. 指令 alias 语法: alias file-path|directory-path; 默认值: no 作用域: location 该指令设置指定location使用的路径.注意它跟 root 相似,但是不改变文件的根路径,仅仅是使用文件系统路径.比如: location&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; /i/ {  alias  /spool/w3/i

Nginx系列教程:NginxHttpOwnerMatch模块(解决链接型文件跨站访问)

概述 该模块提供了一个简单文件基于所有者的http://www.aliyun.com/zixun/aggregation/38609.html">访问控制. nginx_http_owner_match_module模块使得它可以控制具体文件的所有者和组织的访问. 访问规则检查是根据其声明的顺序. 配置范例: location / {  omallow heiher;  # allow access files of heiher  omallow jack sftp; # allow a

Nginx系列教程:事件模块

设置Nginx处理连接请求 指令 accept_mutex Syntax: accept_mutex [ on | off ] Default: on nginx 使用连接互斥锁进行顺序的accept()系统调用. accept_mutex_delay Syntax: accept_mutex_delay Nms; Default: 500ms 如果一个进程没有互斥锁,它将延迟至少多长时间.默认情况下,延迟是500ms . debug_connection Syntax: debug_conne

Nginx系列教程:HTTP Secure Link模块

此模块计算和检查要求所需的安全链接网址.此模块默认情况下不会被编译启用,要启用它请使用指令 --with-http_secure_link_module 参与编译安装 nginx .注意:此模块仅在 nginx 版本为0.7.18或更高时才被支持. 配置实例: location /p/ { location ~ ^/p/(?<secure>[\w\-=]+,\d+)(?<file>/.+)$ {  secure_link $secure; secure_link_md5 $secu

Nginx系列教程:LNMP多用户动态进程管理虚拟主机方案

A. 特点1. 高效.内存使用少.2. 权限分离,用户间互不干扰.3. 动态进程管理,资源分配均衡. B. 应用程序说明Nginx:事件驱动的 Web 服务器,采用模块化设计,小巧.高效.PHP-FPM:支持快速进程管理的 PHP FastCGI 接口版本,用它实现动态进程管理,提高资源使用效率. C. 整个架构的简单说明Nginx 处理所有的 Web 请求,它将 PHP 的请求 Match 出,发送给上游服务器处理,这里的上游服务器就是 PHP-CGI.PHP-CGI 工作在 FastCGI

Nginx系列教程:LNMP多用户虚拟主机方案

A. 特点1. 高效.内存使用少.2. 权限分离,用户间互不干扰. B. 应用程序说明Nginx : 事件驱动的 Web 服务器,采用模块化设计,小巧.高效.PHP-CGI : PHP的CGI接口版本(本文使用FastCGI高效接口). C. 整个架构的简单说明Nginx 处理所有的 Web 请求,它将 PHP 的请求 Match 出,发送给上游服务器处理,这里的上游服务器就是 PHP-CGI.PHP-CGI 工作在 FastCGI 模式,它侦听着一个地址端口(或 Unix socket文件,建