我尝试在memcached中使用nginx,配置如下:
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支持启用配置参数:-前缀=/etc/nginx-conf-path=/etc/nginx/nginx.conf-错误-日志路径=/var/log/nginx/error.log--V-路径=/var/log/nginx/access.log.log-http-代理-temp-path=/var/lib/nginx/代理--http-scgi-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-http_image_模块-with-http_gzip_static_模块-with-http_gzip_static_模块带-http_realip_ _filter_module __filter_module__filter_module_stub__filter_module__filter_module__filter_module=/usr/_filter_module/_filter_module-add-module=/build/buildd/nginx-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/modules/nginx-dav-ext-module
输出中没有ngx_http_memcached_module。
我使用apt-get install nginx安装的Ubuntu12.04和nginx。
这是否意味着我必须安装它才能使用memcached或其他什么东西?
发布于 2012-11-05 13:21:28
来自pass
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应用程序。
https://stackoverflow.com/questions/13232742
复制相似问题