2

この構成で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;
    }

}

ただし、すべてのリクエストはmemcacheを使用せずにuwsgiに送信されます。

nginx -V

nginx -V nginxバージョン:nginx / 1.1.19 TLS SNIサポートが有効な構成引数:-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-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-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-http_xslt_module --with-ipv6 --with-sha1 = / usr / include / openssl --with-md5 = / 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 / 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-module19 / 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-module19 / 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はありません。

Ubuntu12.04とnginxをインストールして使用していapt-get install nginxます。

memcachedなどを使用するにはインストールする必要があるということですか?

4

1 に答える 1

3

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アプリであるはずです

于 2012-11-05T13:21:28.917 に答える