nginx的memcached

我尝试使用带有此configuration的memcachednginx

server { ... location / { default_type text/html; set $memcached_key $uri; memcached_pass 127.0.0.1:11211; error_page 404 = @fallback; } location @fallback { include uwsgi_params; uwsgi_pass unix:///var/tmp/site.sock; } } 

但是,所有的请求都转到了uwsgi而没有使用memcache:

nginx -V

nginx -V nginx版本:nginx / 1.1.19启用了TLS SNI支持的configuration参数:–prefix = / etc / nginx –conf – path = / etc / nginx / nginx.conf –error-log-path = / var /log/nginx/error.log –http-client-body-temp-path = / var / lib / nginx / body –http -fastcgi -temp path = / var / lib / nginx / fastcgi –http- log-path = / var / log / nginx / access.log –http-proxy-temp-path = / var / lib / nginx / proxy –http -script -temp path = / var / lib / nginx / scgi –http-uwsgi-temp-path = / var / lib / nginx / uwsgi –lock-path = / var / lock / nginx.lock –pid-path = / var / run / nginx.pid –with- debug –with-http_addition_module –with-http_dav_module –with-http_geoip_module –with-http_gzip_static_module –with-http_image_filter_module –with-http_realip_module –with-http_stub_status_module –with-http_ssl_module –with-http_sub_module –with- / usr / include / openssl –with-mail –with-mail_ssl_module –add-module = / build / buildd /nginx-1.1.19/debian/modules/nginx-auth-pam –add-module = / build / buildd / ng inx-1.1.19 / debian / modules / nginx-echo -add-module = / build / buildd / nginx-1.1.19 / debian / modules / nginx-upstream-fair –add-module = / build / buildd / nginx的-1.1.19 / Debian的/模块/ nginx的-DAV-EXT-模块

输出中没有ngx_http_memcached_module。

我使用apt-get install nginx安装Ubuntu 12.04和apt-get install nginx

这是否意味着我必须安装它使用memcached或别的东西?

来自http://nginx.org/en/docs/http/ngx_http_memcached_module.html#memcached_pa​​ss

 The ngx_http_memcached_module module allows to obtain responses from a memcached server. The key is set in the $memcached_key variable. A response should be put in memcached in advance via means that are external to nginx. 

换句话说,nginx只能检索已存储在memcache中的东西

means that are external to nginx应该很可能是你的uwsgi应用程序