首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >nginx memcached

nginx memcached
EN

Stack Overflow用户
提问于 2012-11-05 13:04:57
回答 1查看 7.6K关注 0票数 2

我尝试在memcached中使用nginx,配置如下:

代码语言:javascript
运行
复制
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或其他什么东西?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-11-05 13:21:28

来自pass

代码语言:javascript
运行
复制
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应用程序。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13232742

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档